On 9/9/06, Philipp Bracher <[email protected]> wrote:
>> >> Perhaps we should really wait until John was able to make the >> solution A) working. > > I've prepared the code ( > http://svn.sourceforge.net/viewvc/openwfe/trunk/openwfe/openwfe- > applic/src/main/java/openwfe/org/util/beancoder/ > AbstractBeanCoder.java?revision=3241&view=markup > ) : on monday, Nicolas and I will write its JCR extension based on the > current XML extension ( > http://svn.sourceforge.net/viewvc/openwfe/trunk/openwfe/openwfe- > applic/src/main/java/openwfe/org/util/beancoder/XmlBeanCoder.java? > revision=3241&view=markup > ). > > We don't mean to bring an absolute solution, if you people come up > with another, better, solution we'll be glad to support it. I walked through the code and I think this will work quite well.But one remark I have: how will you encode a bean like this masterObject - size (10) - subObject - myString (holdrio) - map - one = 1 - two = 2 Not sure if I'm right but I think your implementation will have a problem to distinguish a property witch will end up as JCR property and a structures like beans and maps witch will have to create a node first. Perhaps it's solvable but I'm not sure. The problem is that encodeField is calling encode, but once it should simply set a value and the other time it should add properties to a node. The uppder should get transformed to this: n: masterObject p: size = 10 n: subObject p: myString = holdrio n: map p: one = 1 p: two = 2 And not to this: n: masterObject n: size p: value = 10 n: subObject n: myString p: value = holdrio n: map n: one p: value = 1 n: two p: value = 2 where n means node and p means property
Hi Philipp, we're then on the same wavelength, it's our goal to have a JCR structure as simple as possible. Implementing the JcrBeanCoder will certainly yield modifications to the abstract classes and interfaces uphill, hopefully on tuesday we should have a working XmlBeanCoder and JcrBeanCoder (names may change).
Nice start anyway and exactly going in the direction I had in mind. Just wanted to get sure that we have the same idea how the structure should look like
Thanks for the help, ttys, John ---------------------------------------------------------------- for list details see http://www.magnolia.info/en/magnolia/developer.html ----------------------------------------------------------------
