[opencms-dev] NullPointerException when saving. Problem withdefault body and locales.

Jonathan Woods jonathan.woods at scintillance.com
Tue Nov 28 11:04:08 CET 2006


Bart -

The thing you 'copy body from': can't that be a snippet of XML which
includes empty bodies for all the languages you want?  Then you'd start off
with all the necessary body elements defined.  In other words:

<?xml version="1.0" encoding="UTF-8"?>

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.opencms.org/dtd/6.0/xmlpage.xsd">
  <page language="en">
    <element name="body">
      <links/>
      <content><![CDATA[]]></content>
    </element>
  </page>
  <page language="de">
    <element name="body">
      <links/>
      <content><![CDATA[]]></content>
    </element>
  </page></pages> 

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of bart vandendriessche
Sent: 28 November 2006 09:52
To: The OpenCms mailing list
Subject: [opencms-dev] NullPointerException when saving. Problem withdefault
body and locales.

Hey all,

I am working on a multilingual site which has one root folder per locale, so
e.g.:
en
de
fr

The use case that we are promoting for content that is available in multiple
languages, is to create the page in one language, for example in the en
folder, and then when the german content is to be added, create a sibling in
the de folder that links back to the file in the en folder.

This site uses a custom template, so for now, we are always assigning the
default body as the "Copy body from" property. Now, creating the file in the
en folder and editing its english content works fine. 
However, when I switch the language inside the FCKeditor, there will be no
*body element available. I am able to enter content for my newly selected
language, but when I try to save, a NullPointerException is thrown.
Currently, I have discovered a work around where I can:
a) create the page in English
b) add english content
c) switch to german language
d) add german content
e) switch back to english language
f) save

After doing this, the *body element will be available to the german
language. However, this workaround is cumbersome for our customers.
It might be of interest that I am currently using OpenCms 6.2.1, so maybe
this is fixed in a later version. If not, any insight or tips will be much
appreciated.

Regards,
Bart

_______________________________________________
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