[opencms-dev] OpenCMS Access

] Code Create [ Bernd Wolfsegger bw at code-create.com
Sun Oct 18 22:34:01 CEST 2009


Hi Markus,

as a starting point I could think of the CmsStaticExportManager class which
"export(...)" method should even work without a Request or Response object.
One had to write a new class for the purpose which uses some configuration data
and methods from a CmsStaticExportManager instance which is available via the
OpenCms class and write some code like the one in the export(..) and
writeResource(..) methods so that it fits the needs for getting the rendered
resource not in a file but on the fly for the email to send.

Unfortunately it seems not possible to configure an extended
CmsStaticExportManager to be used in the OpenCms configuration files.

Kind regards, Bernd

-----Ursprüngliche Nachricht-----
Von: May, Markus [mailto:mmay at janolaw.de] 
Gesendet: Freitag, 16. Oktober 2009 09:22
An: 'bw at code-create.com'; 'The OpenCms mailing list'
Betreff: AW: [opencms-dev] OpenCMS Access

Hello Bernd,

Thats exactly what I would like to do. The OpenCMS API call would my favourite.
Could you just point me to the right Class?

R,

Markus

-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im
Auftrag von ] Code Create [ Bernd Wolfsegger
Gesendet: Donnerstag, 15. Oktober 2009 19:21
An: 'The OpenCms mailing list'
Betreff: Re: [opencms-dev] OpenCMS Access

Hi Markus,

so what you like to implement is to have the structured content generated as
usual but nor for the browser client but on the server itself to be able to send
it via email?
One way would be to export the structured content and then use the generates
file for whatever purpose.
But I think there may be also possibilities in the OpenCms API to get the
generated content via a "dummy" Request programmatically.

Though, I would have to study the API to get the idea :-)

Kind regards, Bernd

-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im
Auftrag von May, Markus
Gesendet: Donnerstag, 15. Oktober 2009 17:58
An: 'kuku at physik.rwth-aachen.de'; 'opencms-dev at opencms.org'
Betreff: Re: [opencms-dev] OpenCMS Access

 I think we misunderstood each other, probably I was using the word Template in
the wrong context.

To clear this up. We are right now using HTML-Files in the OpenCMS without any
Templates and/or schema behind. These Files do just contain plain HTML. This is
what we are using for the eMail Stuff in our Module, and this is done in JAVA
and not in JSPs.

What we are looking for, is basically a way to retrieve the full HTML-file after
we migrated to using Templates for them.

R,

Markus

-----Ursprüngliche Nachricht-----
Von: Christoph P. Kukulies [mailto:kuku at physik.rwth-aachen.de]
Gesendet: Donnerstag, 15. Oktober 2009 17:36
An: May, Markus
Betreff: Re: [opencms-dev] OpenCMS Access

Maybe some of the CmsXml classes might do?
Don't know. Is the content of the Email in these XML files?
Would you have to parse the XML?

I'm using the CmsHtmlMail class in a jsp to send Email like this:
   CmsHtmlMail htmlmail= new CmsHtmlMail();

   htmlmail.addTo("kuku at somewhere.de","Company GmbH");
   htmlmail.addCc("meier at somewhere.de","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung at company.de");
   htmlmail.setSubject("Anmeldung");
   htmlmail.setCharset("iso-8859-2");
   htmlmail.setHtmlMsg(
   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
\"http://www.w3.org/TR/html4/loose.dtd\">\r"+
"<html>\r"+
"<head>\r"+
"<title>Registrierung</title>\r"+
"<style type=\"text/css\">\r"+
"body {\r"+
"    font-family: Tahoma, Helvetica, Arial, sans-serif;"+
"    font-size: 12px;"+
"    text-align: left;"+
"    background:#f0f2f4;"+
"    color: #11316c;"+
"}"+
"td {     text-align: left;\r     vertical-align: top;\r"+
"</style>\r"+
...


And the htmlmail.send();



--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de

On Thu, Oct 15, 2009 at 05:02:21PM +0200, May, Markus wrote:
> Hello,
>
> We are basically right now reading the Content of the XML-File and
> therefor we
are not able to construct the email from it, because the email should be
"transformed" to an HTML-File. Like stated, right now the XML-File is read
directly and this file contains a kind of static HTML-page.
>
> IMHO, this should be done in a more CMS like way and we are trying to
> avoid
the readFile() construct. What I would like to get is basically the "exported"
HTML-page from the template. Could this be done in a program?
>
> R,
>
> Markus
>
> -----Urspr?ngliche Nachricht-----
> Von: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Christoph P.
> Kukulies
> Gesendet: Donnerstag, 15. Oktober 2009 16:51
> An: The OpenCms mailing list
> Betreff: Re: [opencms-dev] OpenCMS Access
>
> Markus,
>
> what are you intending to do with readFile()?
> Inclusion in templates is mostly done by constructs like
>
> <cms:template element="head" >
> <cms:include file="../elements/head" element="head"/> </cms:template>
>
> Or do I misunderstand something.
>
> On Thu, Oct 15, 2009 at 04:38:46PM +0200, May, Markus wrote:
> > Hello,
> >
> > We have now (finally) transferred our site to 7.5.1, thanks for the
> > great
help. We are now trying to do something really easy (at least I hope so).
> >
> > We have a couple of files, which are basically full HTML-Files
> > including the
Header and so on. These are mainly used for emailing. Now we would like to use
some Templates there as well, so that it is easier to use for our Authors.
> >
> > Right now we are just using the CMSObject.readFile() Method, but
> > this will
not work, if we would like to use the Template variant. Any help?
> >
> > Mit freundlichen Gr??en
> >
> > Markus M. May
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
>

_______________________________________________
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


_______________________________________________
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




More information about the opencms-dev mailing list