Hello Serge,

It indeed is complicated. At least I am able to get the values for all languages in the source (to be moved) container. The problem is how to place them into the current target container (which is in the process of being created).

My code, which moves all container fields along with the moved page, is in an event listener in the addContainerEngineAfterInit event (similar to the eventlistener.jsp in the corporate_portal_templates).

If I call
jField = targetContainer.getField(fieldName)
I can get the field of the current container and can set the value just for the current language.

If I call
jField.getContentField()
on that variable I get null, so I cannot access the content objects for all the different languages. How else could I save a field in all the different languages within my event-listener? Do I have access to the JahiaContentContainerFacade? The values of course should not be persisted right ahead, but only when the user presses OK or "Save and new".

Greetings,
Benjamin Papez

Serge Huber <[EMAIL PROTECTED]> wrote on 23.09.2004 15:24:44:

>
> Hi Benjamin,
>
> That is more complex, because in the context of a page you only have
> access to the current requested language data. You might try something
> with the ContentObject hierarchy but again this is not trivial to
> achieve. As for copying file field data it depends if you really want to
> copy the content of the file or just the field. If it's just the field a
> simple get/setValue should work.
>
> Regards,
>   Serge Huber.
>
> [EMAIL PROTECTED] wrote:
>
> > Thank you very much. I have looked, what you have done in the
> > eventlistener.jsp and it works for us. Still we have a problem to copy
> > not only the current value of a field like in your example, but we
> > would like to move the text for ALL languages of a field and I we
> > would also like to move complex fields like file-fields. How can we do
> > that?
> >  
> > Regards,
> > Benjamin Papez
> >
> >
> > -----St�phane Croisier <[EMAIL PROTECTED]> wrote: -----
> >
> > >To:
> > >From: St�phane Croisier
> > >Date: 09/15/2004 04:39PM
> > >Subject: Re: Moving container, when page is moved
> > >
> > >
> > >Hello,
> > >
> > >When you move a page, you move the page field alone not the full
> > >parent container (because the destination container may be different
> > >from the original source container). But if you know the destination,
> > >you may create an event listenrer to copy the values of the parent
> > >container into the new destination container. Please take a look a
> > >the the "document_listing" template which includes such a mechanism.
> > >
> > >
> > >Cheers,
> > >St�phane
> > >
> > >At 12:40 15/09/2004, you wrote:
> > >
> > >
> > >We have container lists holding category containers and service
> > >containers. Both containers hold a page and some additional fields
> > >belonging to categories or services. Now the page_field would allow
> > >for linking to pages and moving pages around. Unfortunately only the
> > >page is moved and not the additional fields of the container.
> > >
> > >Do you have a suggestion or idea how we could also move the other
> > >fields of the container, when the page is moved?
> > >
> > >Regards,
> > >Benjamin Papez
>
>

Reply via email to