jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peña Hernando, Enrique <enrique.p...@ineco.es>
Subject RE: Deleting versions when orignal node is deleted
Date Wed, 03 Aug 2011 14:15:38 GMT
Thanks a lot for your reply Jukka.

For searching all nt:versionHistory nodes I have this code:
        StringBuilder sb = new StringBuilder();
      sb.append("SELECT * FROM [nt:versionHistory]");
      NodeIterator nit2;
      nit2 = sesion.getWorkspace().getQueryManager().createQuery(sb.toString(),Query.JCR_SQL2).execute().getNodes();

but I'm getting 0 nodes after the query.
What I am doing wrong?



-----Mensaje original-----
De: Jukka Zitting [mailto:jukka.zitting@gmail.com]
Enviado el: miércoles, 03 de agosto de 2011 12:29
Para: users@jackrabbit.apache.org
Asunto: Re: Deleting versions when orignal node is deleted

Hi,

2011/8/3 Peña Hernando, Enrique <enrique.pena@ineco.es>:
> Is there a way of deleting those orphan versions?

You should be able to search for all nt:versionHistory nodes and then
use the VersionHistory interface to remove all versions from those
version histories that are not referenced in content. Once the last
version of an orphan version history is removed, also the history node
gets automatically removed.

BR,

Jukka Zitting

Advertencia / Confidentiality Notice

Este envío es confidencial y está destinado únicamente a la persona a la que ha sido enviado.
Puede contener información privada y confidencial. Si usted no es el destinatario al que
ha sido remitida, no puede copiarla, distribuirla ni emprender con ella ningún tipo de acción.
Si cree que lo ha recibido por error, por favor, notifíquelo al remitente.

This e-mail message, and all attachments transmitted with it, are intended solely for the
use of the addressee and may contain privileged and confidential information. If you are not
the intended recipient, you should not copy, distribute or make any other use of this e-mail
or its attachments. If you believe that you have received this transmission in error, please
notify the sender.

Antes de imprimir este mensaje, piense si realmente es necesario hacerlo, El medio ambiente
se lo agradecerá.

Mime
View raw message