You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Er...@sanofipasteur.com on 2006/08/16 11:05:19 UTC

Calling flush or invalidate from template

Hi all,
 
I would like to call Roller.flush and/or CacheManager.invalidate from a
template.
I can't figure out how to do it.
Any idea?
 
regards
 
Eric
-------------------------------------------------------------------------------------------
"Cette communication (y compris les pieces jointes) est reservee a l'usage exclusif du destinataire (des destinataires) et peut contenir des informations privilegiees, confidentielles, exemptees de divulgation selon la loi ou protegees par les droits d'auteur. Si vous n'etes pas un destinataire, toute utilisation, divulgation, distribution, reproduction, examen ou copie (totale ou partielle) est non-autorisee et peut etre illegale. Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. Sanofi Pasteur decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur de l'erreur de distribution et de la destruction du message. Merci.
This transmission (including any attachments) is intended solely for the use of the addressee(s) and may contain confidential information including trade secrets which are privileged, confidential, exempt from disclosure under applicable law and/or subject to copyright. If you are not an intended recipient, any use, disclosure, distribution, reproduction, review or copying (either whole or partial) is unauthorized and may be unlawful. E-mails are susceptible to alteration and their integrity cannot be guaranteed.Sanofi Pasteur shall not be liable for this e-mail if modified or falsified. If you are not the intended recipient of this e-mail, please delete it immediately from your system and notify the sender of the wrong delivery and the mail deletion. Thank you."
**********************************************************************


Re: Calling flush or invalidate from template

Posted by Allen Gilliland <al...@sun.com>.
yes, unfortunately Erik is correct, all of the wrappers have a getPojo() 
method which provides access to the original pojo.

the reason for this is because there are parts of the model code which 
required access to the original pojo to work, so that method had to be 
added.  of course it's undocumented, unsupported, and as soon as we can 
remove it we will.

in any case, as Dave suggested, you shouldn't be modifying data via your 
templates.  they aren't designed for that and that will never be 
supported by Roller.

-- Allen


Eric.Bardoux@sanofipasteur.com wrote:
> Hmm, believe me Dave, from the wrapper, i can call the "getPojo()" method and have the pojo ;)
> I change the category from my template, i only can't flush the cash, and have to do it from the admin ihm.
> 
> But don't worry, i'll use a task instead. 
> 
> -----Message d'origine-----
> De : Dave Johnson [mailto:snoopdave@gmail.com] 
> Envoyé : mercredi 16 août 2006 15:50
> À : roller-dev@incubator.apache.org
> Objet : Re: Calling flush or invalidate from template
> 
> On 8/16/06, Eric.Bardoux@sanofipasteur.com <Er...@sanofipasteur.com> wrote:
>> Oh ok.
>> But from the wrapper, i can get the pojo. From the pojo, i can change some properties (in my case, i want to change the Category of an entry), but i can't call the save method of the pojo, neither flush the cash.
> 
> Actually, you can only get POJO wrappers -- which are not persisted in the database.
> 
> - Dave
> -------------------------------------------------------------------------------------------
> "Cette communication (y compris les pieces jointes) est reservee a l'usage exclusif du destinataire (des destinataires) et peut contenir des informations privilegiees, confidentielles, exemptees de divulgation selon la loi ou protegees par les droits d'auteur. Si vous n'etes pas un destinataire, toute utilisation, divulgation, distribution, reproduction, examen ou copie (totale ou partielle) est non-autorisee et peut etre illegale. Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. Sanofi Pasteur decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur de l'erreur de distribution et de la destruction du message. Merci.
> This transmission (including any attachments) is intended solely for the use of the addressee(s) and may contain confidential information including trade secrets which are privileged, confidential, exempt from disclosure under applicable law and/or subject to copyright. If you are not an intended recipient, any use, disclosure, distribution, reproduction, review or copying (either whole or partial) is unauthorized and may be unlawful. E-mails are susceptible to alteration and their integrity cannot be guaranteed.Sanofi Pasteur shall not be liable for this e-mail if modified or falsified. If you are not the intended recipient of this e-mail, please delete it immediately from your system and notify the sender of the wrong delivery and the mail deletion. Thank you."
> **********************************************************************
> 

RE: Calling flush or invalidate from template

Posted by Er...@sanofipasteur.com.
Hmm, believe me Dave, from the wrapper, i can call the "getPojo()" method and have the pojo ;)
I change the category from my template, i only can't flush the cash, and have to do it from the admin ihm.

But don't worry, i'll use a task instead. 

-----Message d'origine-----
De : Dave Johnson [mailto:snoopdave@gmail.com] 
Envoyé : mercredi 16 août 2006 15:50
À : roller-dev@incubator.apache.org
Objet : Re: Calling flush or invalidate from template

On 8/16/06, Eric.Bardoux@sanofipasteur.com <Er...@sanofipasteur.com> wrote:
> Oh ok.
> But from the wrapper, i can get the pojo. From the pojo, i can change some properties (in my case, i want to change the Category of an entry), but i can't call the save method of the pojo, neither flush the cash.

Actually, you can only get POJO wrappers -- which are not persisted in the database.

- Dave
-------------------------------------------------------------------------------------------
"Cette communication (y compris les pieces jointes) est reservee a l'usage exclusif du destinataire (des destinataires) et peut contenir des informations privilegiees, confidentielles, exemptees de divulgation selon la loi ou protegees par les droits d'auteur. Si vous n'etes pas un destinataire, toute utilisation, divulgation, distribution, reproduction, examen ou copie (totale ou partielle) est non-autorisee et peut etre illegale. Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. Sanofi Pasteur decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur de l'erreur de distribution et de la destruction du message. Merci.
This transmission (including any attachments) is intended solely for the use of the addressee(s) and may contain confidential information including trade secrets which are privileged, confidential, exempt from disclosure under applicable law and/or subject to copyright. If you are not an intended recipient, any use, disclosure, distribution, reproduction, review or copying (either whole or partial) is unauthorized and may be unlawful. E-mails are susceptible to alteration and their integrity cannot be guaranteed.Sanofi Pasteur shall not be liable for this e-mail if modified or falsified. If you are not the intended recipient of this e-mail, please delete it immediately from your system and notify the sender of the wrong delivery and the mail deletion. Thank you."
**********************************************************************


Re: Calling flush or invalidate from template

Posted by Dave Johnson <sn...@gmail.com>.
On 8/16/06, Eric.Bardoux@sanofipasteur.com
<Er...@sanofipasteur.com> wrote:
> Oh ok.
> But from the wrapper, i can get the pojo. From the pojo, i can change some properties (in my case, i want to change the Category of an entry), but i can't call the save method of the pojo, neither flush the cash.

Actually, you can only get POJO wrappers -- which are not persisted in
the database.

- Dave

RE: Calling flush or invalidate from template

Posted by Er...@sanofipasteur.com.
Oh ok.
But from the wrapper, i can get the pojo. From the pojo, i can change some properties (in my case, i want to change the Category of an entry), but i can't call the save method of the pojo, neither flush the cash.
Well, i guess i will do what i wanted to do through a scheduled task.

Thanks

Eric 

-----Message d'origine-----
De : Dave Johnson [mailto:snoopdave@gmail.com] 
Envoyé : mercredi 16 août 2006 14:50
À : roller-dev@incubator.apache.org
Objet : Re: Calling flush or invalidate from template

On 8/16/06, Eric.Bardoux@sanofipasteur.com <Er...@sanofipasteur.com> wrote:
> I would like to call Roller.flush and/or CacheManager.invalidate from 
> a template. I can't figure out how to do it.
> Any idea?

Not possible with stock Roller.

We don't want template authors to call anything other than the PageModel and the POJO wrappers, so we don't make any backend objects available in the template context.

- Dave
-------------------------------------------------------------------------------------------
"Cette communication (y compris les pieces jointes) est reservee a l'usage exclusif du destinataire (des destinataires) et peut contenir des informations privilegiees, confidentielles, exemptees de divulgation selon la loi ou protegees par les droits d'auteur. Si vous n'etes pas un destinataire, toute utilisation, divulgation, distribution, reproduction, examen ou copie (totale ou partielle) est non-autorisee et peut etre illegale. Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. Sanofi Pasteur decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur de l'erreur de distribution et de la destruction du message. Merci.
This transmission (including any attachments) is intended solely for the use of the addressee(s) and may contain confidential information including trade secrets which are privileged, confidential, exempt from disclosure under applicable law and/or subject to copyright. If you are not an intended recipient, any use, disclosure, distribution, reproduction, review or copying (either whole or partial) is unauthorized and may be unlawful. E-mails are susceptible to alteration and their integrity cannot be guaranteed.Sanofi Pasteur shall not be liable for this e-mail if modified or falsified. If you are not the intended recipient of this e-mail, please delete it immediately from your system and notify the sender of the wrong delivery and the mail deletion. Thank you."
**********************************************************************


Re: Calling flush or invalidate from template

Posted by Dave Johnson <sn...@gmail.com>.
On 8/16/06, Eric.Bardoux@sanofipasteur.com
<Er...@sanofipasteur.com> wrote:
> I would like to call Roller.flush and/or CacheManager.invalidate from a
> template. I can't figure out how to do it.
> Any idea?

Not possible with stock Roller.

We don't want template authors to call anything other than the
PageModel and the POJO wrappers, so we don't make any backend objects
available in the template context.

- Dave