OpenCMS Access

View: New views
8 Messages — Rating Filter:   Alert me  

OpenCMS Access

by May, Markus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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

janolaw AG
Otto-Volger-Straße 3c
65843 Sulzbach / Ts.
Telefon: +49 (0) 6196 - 7722 -552
Telefax: +49 (0) 6196 - 7722 -511
E-Mail: mmay@...
http://www.janolaw.de

Die janolaw AG wird vertreten durch den Vorstand: Dr. Ha-Sung Chung
Vorsitzender des Aufsichtsrats ist WP/Stb. Dieter Kapp, Frankfurt am Main
Amtsgericht Frankfurt am Main HRB 50 880
 
 


_______________________________________________
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

Re: OpenCMS Access

by Christoph P. Kukulies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: OpenCMS Access

by May, Markus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... [mailto:opencms-dev-bounces@...] 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

Parent Message unknown Re: OpenCMS Access

by May, Markus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 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@...]
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@...","Company GmbH");
   htmlmail.addCc("meier@...","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung@...");
   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@...
> [mailto:opencms-dev-bounces@...] 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

Re: OpenCMS Access

by ] Code Create [ Bernd Wolfsegger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... [mailto:opencms-dev-bounces@...] Im
Auftrag von May, Markus
Gesendet: Donnerstag, 15. Oktober 2009 17:58
An: 'kuku@...'; 'opencms-dev@...'
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@...]
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@...","Company GmbH");
   htmlmail.addCc("meier@...","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung@...");
   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@...
> [mailto:opencms-dev-bounces@...] 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

Re: OpenCMS Access

by May, Markus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... [mailto:opencms-dev-bounces@...] 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@... [mailto:opencms-dev-bounces@...] Im Auftrag von May, Markus
Gesendet: Donnerstag, 15. Oktober 2009 17:58
An: 'kuku@...'; 'opencms-dev@...'
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@...]
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@...","Company GmbH");
   htmlmail.addCc("meier@...","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung@...");
   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@...
> [mailto:opencms-dev-bounces@...] 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

_______________________________________________
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

Re: OpenCMS Access

by Rodriguez, Adrian-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Markus,

we use the following code to trigger the template mechanism in OpenCms. In the example, myEmail.html is a resource of type XmlPage with a template assigned.

CmsObject cms=...;
HttpServletRequest request=...;
HttpServletResponse response=new DummyResponse();
CmsResource resource=cms.readResource("/myEmail.html");

I_CmsResourceLoader loader = OpenCms.getResourceManager().getLoader(resource);    
cms.getRequestContext().setUri(cms.getSitePath(resource));
               
byte[]result= loader.export(cms,resource,request,response);

public class DummyResponse implements HttpServletResponse {

    public ServletOutputStream getOutputStream() throws IOException {

        return new ServletOutputStream(){

            public void write(int b) throws IOException {
                // Do nothing
               
            }
            public void write(byte[] b) throws IOException {
                //Do nothing
               
            }
            public void flush() throws IOException {
                //Do nothing
               
            }    

        };
    }

   // ... Rest of the implemented methods of HttpServletResponse
}


The reason why response is of type DummyResponse, is because in the process of exporting, OpenCms tries to write to it. It can also be useful if in you don't have access to a real HttpServletRequest at all. Then you should use a kind of dummy HttpServletRequest.

This is working, but the problem is that it is completely dependent of the use of the response that the OpenCms implementation does, so I will be very glad to know if there is a more elegant approach.

Kind regards,

Adrián Rodríguez
comundus GmbH

-----Original Message-----
From: opencms-dev-bounces@... [mailto:opencms-dev-bounces@...] On Behalf Of May, Markus
Sent: Friday, October 16, 2009 9:22 AM
To: 'bw@...'; 'The OpenCms mailing list'
Subject: Re: [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@... [mailto:opencms-dev-bounces@...] 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@... [mailto:opencms-dev-bounces@...] Im Auftrag von May, Markus
Gesendet: Donnerstag, 15. Oktober 2009 17:58
An: 'kuku@...'; 'opencms-dev@...'
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@...]
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@...","Company GmbH");
   htmlmail.addCc("meier@...","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung@...");
   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@...
> [mailto:opencms-dev-bounces@...] 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

_______________________________________________
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

Parent Message unknown Re: OpenCMS Access

by ] Code Create [ Bernd Wolfsegger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...]
Gesendet: Freitag, 16. Oktober 2009 09:22
An: 'bw@...'; '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@... [mailto:opencms-dev-bounces@...] 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@... [mailto:opencms-dev-bounces@...] Im
Auftrag von May, Markus
Gesendet: Donnerstag, 15. Oktober 2009 17:58
An: 'kuku@...'; 'opencms-dev@...'
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@...]
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@...","Company GmbH");
   htmlmail.addCc("meier@...","Company GmbH");
   htmlmail.setFrom("Infoveranstaltung@...");
   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@...
> [mailto:opencms-dev-bounces@...] 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


_______________________________________________
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