Purge tests cover more now. Moved purging queries into mapping file.

Added call to AVMService to get Versions
by creation date.  GetRepositoryVersions methods now return Lists of 
VersionDescriptors, value objects with the attributes of a version.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3131 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-06-17 18:48:44 +00:00
parent a215fb72b6
commit 9c17cfa1e0
16 changed files with 439 additions and 131 deletions

View File

@@ -21,9 +21,9 @@ import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.alfresco.repo.avm.SuperRepository;
import org.alfresco.repo.avm.hibernate.HibernateHelper;
@@ -645,7 +645,7 @@ public class AVMServiceImpl implements AVMService
/* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMService#getRepositoryVersions(java.lang.String)
*/
public Set<Integer> getRepositoryVersions(final String name)
public List<VersionDescriptor> getRepositoryVersions(final String name)
{
if (name == null)
{
@@ -653,7 +653,7 @@ public class AVMServiceImpl implements AVMService
}
class HTxnCallback implements HibernateTxnCallback
{
public Set<Integer> versions;
public List<VersionDescriptor> versions;
public void perform(Session session)
{
@@ -666,6 +666,35 @@ public class AVMServiceImpl implements AVMService
return doit.versions;
}
/**
* Get version IDs by creation date. From or to may be null but not
* both.
* @param name The name of the repository to search.
* @param from The earliest versions to return.
* @param to The latest versions to return.
* @return The Set of matching version IDs.
*/
public List<VersionDescriptor> getRepositoryVersions(final String name, final Date from, final Date to)
{
if (name == null || (from == null && to == null))
{
throw new AVMBadArgumentException("Illegal null argument.");
}
class HTxnCallback implements HibernateTxnCallback
{
public List<VersionDescriptor> versions;
public void perform(Session session)
{
fSuperRepository.setSession(session);
versions = fSuperRepository.getRepositoryVersions(name, from, to);
}
}
HTxnCallback doit = new HTxnCallback();
fTransaction.perform(doit, false);
return doit.versions;
}
/**
* Change what a layered directory points to.
*/