Excellent, thanks Ralf - I'll give that a go. Sounds like it will do exactly what I want :-)
On 07/02/2008, Ralf Hirning <[email protected]> wrote: > Hi Simon, > > try > > Content.getMetaData().setProperty("mgnl:lastmodified", Calendar); > > I created a Magnolia BeanShell (http://www.beanshell.org/) module which > could be usefull for such modifications. After installation (you have to > install bsh-1.3.0.jar as well) there is a new entry in the menu under Tools. > > You can find it at > > http://svn.magnolia.info/svn/modules/community/magnolia-module-remote-shell/trunk/ > > or send me an email (ralf-at-hirning.de) > > For example the script to find all nodes with template "sampleOneColumn" > and display handle, title and modification date looks like this: > > //==================== > import info.magnolia.cms.core.search.Query; > import info.magnolia.cms.util.QueryUtil; > import info.magnolia.cms.core.Content; > statement = "//[EMAIL PROTECTED]:template='sampleOneColumn']"; > repository = "website"; > nodes = QueryUtil.query(repository, statement, Query.XPATH, "nt:base"); > for (it = nodes.iterator(); it.hasNext();) { > node = it.next(); > parent = node.getParent(); > print(parent.getHandle() + ":" + parent.getTitle() + ":" + > parent.getMetaData().getDateProperty("mgnl:lastmodified")); > } > //===================== > > It should be straightforward to set the modification dates using > BeanShell (dont forget to save() after doing the modifications ;.) > > Ralf > > > Simon Goodchild schrieb: > > Hi All, > > > > We're finally rolling out our own site in Magnolia, rather than just > > working on other peoples! One of the things we've done is load up all > > our old news stories, so there's a bit of an archive. We have a > > automatic listing of the news articles, using a script derived from > > something on the wiki, which lists all the articles in date order, > > based on the modification date of each page. This is great for all the > > new stuff, but it means the old news articles are all listed under the > > date they were created in magnolia, and we can find a way to 'tweak' > > these dates to be the date of the original story instead. These values > > aren't visible via the built-in JCR browser, and I can't work out > > anything from the underlying database tables (we use MySQL for the > > repository). > > > > Does anyone know how to manually change the modification date of a > > page, or do we just have to live with dates being wrong on the old > > news articles? > > > > In case it's relevant, our environment is: > > Magnolia 3.0.5 > > MySQL 4.1 > > Linux (Fedora Core 3) > > JDK 1.5 > > Tomcat 5.5 > > > > Many thanks, > > > > Simon > > > > ---------------------------------------------------------------- > > for list details see > > http://documentation.magnolia.info/docs/en/editor/stayupdated.html > > ---------------------------------------------------------------- > > > > > > ---------------------------------------------------------------- > for list details see > http://documentation.magnolia.info/docs/en/editor/stayupdated.html > ---------------------------------------------------------------- > ---------------------------------------------------------------- for list details see http://documentation.magnolia.info/docs/en/editor/stayupdated.html ----------------------------------------------------------------
