Added a semi intelligible toString to VersionDescriptor. Added an interactive

console program for debugging.  Made it so you can't snapshot a version if there's 
nothing to snapshot.  Fixed inactive to active transition in OrphanReaper.
Other odds and ends.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3132 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-06-18 01:19:39 +00:00
parent 9c17cfa1e0
commit 6fff182633
8 changed files with 361 additions and 19 deletions

View File

@@ -91,10 +91,10 @@ class RepositoryImpl implements Repository, Serializable
fRoot.setIsRoot(true);
fSuper.getSession().save(fRoot);
VersionRoot versionRoot = new VersionRootImpl(this,
fRoot,
fNextVersionID,
time,
"britt");
fRoot,
fNextVersionID,
time,
"britt");
fNextVersionID++;
fSuper.getSession().save(versionRoot);
}
@@ -115,6 +115,11 @@ class RepositoryImpl implements Repository, Serializable
@SuppressWarnings("unchecked")
public void createSnapshot()
{
// If the root isn't new, we can't take a snapshot since nothing has changed.
if (!fRoot.getIsNew())
{
// TODO Silently return for now.
}
// Clear out the new nodes.
Query query =
fSuper.getSession().getNamedQuery("AVMNode.ByNewInRepo");
@@ -393,7 +398,8 @@ class RepositoryImpl implements Repository, Serializable
@SuppressWarnings("unchecked")
public List<VersionDescriptor> getVersions()
{
Query query = fSuper.getSession().createQuery("from VersionRootImpl v order by v.versionID");
Query query = fSuper.getSession().createQuery("from VersionRootImpl v where v.repository = :rep order by v.versionID");
query.setEntity("rep", this);
List<VersionRoot> versions = (List<VersionRoot>)query.list();
List<VersionDescriptor> descs = new ArrayList<VersionDescriptor>();
for (VersionRoot vr : versions)