Main Content

Magnolia Community Forums: Get help with Magnolia: Magnolia Import and Export using Groovy


  • somebody
    somebody
    Full name: None
    Posts: 2
    Last post: Oct 9, 2017 10:49:17 PM
    Registered on: Oct 9, 2017
    Magnolia Import and Export using Groovy
    #1 by somebody on Oct 9, 2017 10:48:03 PM

    Hello Team,
    I am planning to perform export and import via groovy scripts (https://documentation.magnolia-cms.com/display/DOCS53/Importing+and+exporting). I want the export job to be executed automatically. how can i add a groovy script to be executed automatically.

  • somebody
    somebody
    Full name: None
    Posts: 2
    Last post: Oct 9, 2017 10:49:17 PM
    Registered on: Oct 9, 2017
    Re: Magnolia Import and Export using Groovy
    #2 by somebody on Oct 9, 2017 10:49:17 PM

    Please guide on how can I schedule this script:

    import info.magnolia.importexport.DataTransporter
    hm = ctx.getHierarchyManager('website')
    newsRoot = hm.getContent('/demo-project/news-and-events/news-overview')
    xmlFileOutput = new FileOutputStream('C:/test/export/news.xml')
    DataTransporter.executeExport(xmlFileOutput, false, false,
    hm.getWorkspace().getSession(), newsRoot.getHandle(), 'website',
    DataTransporter.XML)
    xmlFileOutput.close()

  • tomwespi
    tomwespi
    Full name: Tom Wespi
    Posts: 41
    Last post: Oct 10, 2017 12:10:00 PM
    Re: Magnolia Import and Export using Groovy
    #3 by tomwespi on Oct 10, 2017 8:04:56 AM

    Hi

    Have a look at the scheduler module: https://documentation.magnolia-cms.com/display/DOCS/Scheduler+module

  • marvink2
    marvink2
    Full name: Marvin Kerkhoff
    Posts: 45
    Last post: Nov 22, 2017 9:14:20 AM
    Re: Magnolia Import and Export using Groovy
    #4 by marvink2 on Oct 10, 2017 8:55:17 AM

    Hi, you might be interested in https://wiki.magnolia-cms.com/display/WIKI/Backup+and+Restore+JSP+Scripts
    This could be triggered outside of magnolia context. You can then perform scheduling through system cronjobs.

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/