Retyped a counter so had to muck with many beans. Forced creation of layered directories

to work.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2930 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-21 21:59:41 +00:00
parent dd585adedf
commit df28c98983
30 changed files with 349 additions and 384 deletions

View File

@@ -22,7 +22,6 @@ import java.io.OutputStream;
import java.util.List;
import java.util.Set;
import org.alfresco.repo.avm.AVMNode;
import org.alfresco.repo.avm.AVMService;
import org.alfresco.repo.avm.FolderEntry;
import org.alfresco.repo.avm.Lookup;
@@ -363,10 +362,27 @@ public class AVMServiceImpl implements AVMService
fTransaction.perform(doit);
}
/* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMService#createSnapshot(java.lang.String)
*/
public void createSnapshot(final String repository)
{
class HTxnCallback implements HibernateTxnCallback
{
public void perform(Session session)
{
fSuperRepository.set(new SuperRepositoryImpl(session, fStorage));
fSuperRepository.get().createSnapshot(repository);
}
}
HTxnCallback doit = new HTxnCallback();
fTransaction.perform(doit);
}
/* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMService#lookup(int, java.lang.String)
*/
public AVMNode lookup(final int version, final String path)
public Lookup lookup(final int version, final String path)
{
class HTxnCallback implements HibernateTxnCallback
{
@@ -380,7 +396,7 @@ public class AVMServiceImpl implements AVMService
}
HTxnCallback doit = new HTxnCallback();
fTransaction.perform(doit);
return doit.lookup.getCurrentNode();
return doit.lookup;
}
/* (non-Javadoc)
@@ -440,11 +456,11 @@ public class AVMServiceImpl implements AVMService
/* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMService#getRepositoryVersions(java.lang.String)
*/
public Set<Long> getRepositoryVersions(final String name)
public Set<Integer> getRepositoryVersions(final String name)
{
class HTxnCallback implements HibernateTxnCallback
{
public Set<Long> versions;
public Set<Integer> versions;
public void perform(Session session)
{

View File

@@ -122,7 +122,7 @@ public class RepositoryImpl implements Repository
/* (non-Javadoc)
* @see org.alfresco.repo.avm.Repository#getLatestVersion()
*/
public long getLatestVersion()
public int getLatestVersion()
{
return fData.getNextVersionID();
}
@@ -261,7 +261,7 @@ public class RepositoryImpl implements Repository
throw new AlfrescoRuntimeException("Not a file: " + path + " r " + version);
}
FileNode file = (FileNode)node;
FileContent content = file.getContentForRead(version);
FileContent content = file.getContentForRead(version, this);
return content.getInputStream(fSuper);
}
@@ -278,7 +278,7 @@ public class RepositoryImpl implements Repository
{
FolderEntry item = new FolderEntry();
item.setName(name);
item.setType(listing.get(name).getEntryType());
item.setType(listing.get(name).getType());
results.add(item);
}
return results;
@@ -376,7 +376,7 @@ public class RepositoryImpl implements Repository
/* (non-Javadoc)
* @see org.alfresco.repo.avm.Repository#getVersions()
*/
public Set<Long> getVersions()
public Set<Integer> getVersions()
{
return fData.getRoots().keySet();
}

View File

@@ -335,6 +335,15 @@ public class SuperRepositoryImpl implements SuperRepository
}
}
/* (non-Javadoc)
* @see org.alfresco.repo.avm.SuperRepository#createSnapshot(java.lang.String)
*/
public void createSnapshot(String repository)
{
Repository repo = getRepositoryByName(repository);
repo.createSnapshot();
}
/* (non-Javadoc)
* @see org.alfresco.repo.avm.SuperRepository#remove(java.lang.String, java.lang.String)
*/
@@ -394,7 +403,7 @@ public class SuperRepositoryImpl implements SuperRepository
/* (non-Javadoc)
* @see org.alfresco.repo.avm.SuperRepository#getRepositoryVersions(java.lang.String)
*/
public Set<Long> getRepositoryVersions(String name)
public Set<Integer> getRepositoryVersions(String name)
{
Repository rep = getRepositoryByName(name);
return rep.getVersions();