[opencms-dev] Antwort: Re: How to write into Frontend User-Forms?

Frank Pertack fpertack at vater-gruppe.de
Wed Jun 17 00:24:40 CEST 2009


Hello Mathias, hello Nacho,

thank you for your contributions to finding a solution to my problem with
the "Frontend User-Forms".
Finally it works, when I integrate your advices.

Thank you again,

best regards


Frank Pertack


Vater Solution GmbH
Liebigstraße 26
24145 Kiel

Telefon: +49 431 20084-210
Telefax: +49 431 20084-222
Mobil: +49 151 16353519
mailto: fpertack at vater-gruppe.de
http://www.vater-gruppe.de

Amtsgericht Kiel, HRB 6403
Geschäftsführer:
Klaus-Hinrich Vater
Michael Wiese
-----
Diese Email enthält ggfs. vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese Email
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Email. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Email sind nicht gestattet.



|------------>
| Von:       |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Nacho Fernández Orellana <nacho.fernandez.orellana at gmail.com>                                                                                     |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| An:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |The OpenCms mailing list <opencms-dev at opencms.org>                                                                                                |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Datum:     |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |15.06.2009 13:53                                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Betreff:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [opencms-dev] How to write into Frontend User-Forms?                                                                                          |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Gesendet   |
| von:       |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |opencms-dev-bounces at opencms.org                                                                                                                   |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





Hi Frank and list,

Your frontend-form built using contentload and contentshow should build a
html form whose data will be sent to a certain target page (of course this
page can be the same jsp page that built the form). In any case, the
destination jsp should get the sent parameters and then use them to build
the xml of the phonebook entry.

I recommend programming a simple java bean that has all the elements your
phonebook entry has as fields and that provides a simple "toXml" method
that builds the right xml of a phonebook entry according to your xsd. That
way you could create a java method called something like
"writePhonebookEntry" that does something like:  
PhonebookEntryBean bean = getBeanFromRequestParameters( request ); <--
method to write             CmsFile file = cms.readFile(
PATH_OF_XML_YOU_ARE_EDITING );             file.setContents(
YOUR_BEAN.toXml().getBytes() );             cms.writeFile( file );

Where "cms" is a CmsObject and you have to be in the offline project and
lock the xml file accordingly.
I've always found this to be the simpler way, other method is editing the
xml contents for the modified fields in your form instead of rewriting the
complete well-formed xml. If you need code snippets for that alternative
approach, ask again. Hope this helps. Greetings,

Nacho Fernandez.
_______________________________________________
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/20090617/f3da43dc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090617/f3da43dc/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090617/f3da43dc/attachment-0001.gif>


More information about the opencms-dev mailing list