We have a scheduled updateData job that updates nodes in our workspace (CRUD 
operations on nodes) and then activates/deactivates the nodes as appropriate.  
I am trying to clear the caches so that the pages affected can show the updated 
content.  I have not had any success with my attempts at clearing the cache.  
In code what I do is after the update process has run, invoke the clear and 
activePage methods.  I initially thought only clear would do the trick, but 
neither of them do.  On the public instance I see deleted nodes on the list 
pages until I perform a manual "Activate changes" on the appropriate page on 
the website pane.  Using the Tools->Cache Tools->Flush all caches too does not 
seem to have any effect on the output html from the page.  The manual 
activation does the trick however.  The affected pages are freemarker templates 
that get all the JCR data through a model class.  The queries in the model 
class are raw XPATH queries against our workspace.  There are no paragraphs or 
any other sub-components that I need to worry about, just the node data as 
returned by the model classes.

So, the question is what exactly I need to do to ensure that the affected pages 
are refreshed?

Thanks
Rakesh

  void activatePage( page )
  {
    def node = sessionFactory.websiteSession.getItem( page )
    createSyndicator().activate( node.parent.path,
        new DefaultContent( node, getHierarchyManager( 'website' ) ) )
  }

  void clear( context )
  {
    new FlushCachesCommand().execute context
  }

  private def createSyndicator()
  {
    def syndicator = getComponentProvider().newInstance( Syndicator.class );
    syndicator.init( getUser(), getModule().repository,
        getDefaultWorkspace( getModule().repository ), new Rule() )
    return syndicator
  }


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to