use of org.pentaho.platform.api.repository2.unified.VersionSummary in project pentaho-platform by pentaho.
the class FileSystemRepositoryFileDao method getVersionSummary.
public VersionSummary getVersionSummary(Serializable fileId, Serializable versionId) {
RepositoryFile file = getFile(fileId, versionId);
List<String> labels = new ArrayList<String>();
return new VersionSummary(fileId, (versionId != null ? versionId : fileId), false, file.getCreatedDate(), file.getCreatorId(), StringUtils.EMPTY, labels);
}
use of org.pentaho.platform.api.repository2.unified.VersionSummary in project pentaho-platform by pentaho.
the class FileSystemBackedUnifiedRepository method getVersionSummaryInBatch.
public List<VersionSummary> getVersionSummaryInBatch(List<RepositoryFile> files) {
Assert.notNull(files);
List<VersionSummary> versionSummaryList = new ArrayList<VersionSummary>(files.size());
for (RepositoryFile file : files) {
versionSummaryList.add(getVersionSummary(file.getId(), file.getVersionId()));
}
return versionSummaryList;
}
use of org.pentaho.platform.api.repository2.unified.VersionSummary in project pentaho-platform by pentaho.
the class DefaultUnifiedRepository method getVersionSummaryInBatch.
/**
* {@inheritDoc}
*/
public List<VersionSummary> getVersionSummaryInBatch(final List<RepositoryFile> files) {
Assert.notNull(files);
List<VersionSummary> summaries = new ArrayList<VersionSummary>(files.size());
for (RepositoryFile file : files) {
Assert.notNull(file);
summaries.add(getVersionSummary(file.getId(), file.getVersionId()));
}
return summaries;
}
use of org.pentaho.platform.api.repository2.unified.VersionSummary in project pentaho-platform by pentaho.
the class JcrRepositoryFileDaoIT method testUpdateFile1.
@Test
public // Running within defined date
void testUpdateFile1() throws Exception {
RepositoryFile newFile = createFile("JcrRepositoryFileDaoTest1.test");
IRepositoryFileData dataMock = new SampleRepositoryFileData("", true, 0);
Date startDate = new Date();
newFile = new RepositoryFile.Builder(newFile).createdDate(startDate).build();
repo.updateFile(newFile, dataMock, "edition #2");
List<VersionSummary> summaries = repo.getVersionSummaries(newFile.getId());
Date lastVersionDate = summaries.get(summaries.size() - 1).getDate();
assertEquals("incorrect version date", lastVersionDate, startDate);
}
use of org.pentaho.platform.api.repository2.unified.VersionSummary in project pentaho-kettle by pentaho.
the class UnifiedRepositoryPurgeServiceTest method verifyAllVersionsDeleted.
private static void verifyAllVersionsDeleted(HashMap<String, List<VersionSummary>> versionListMap, IUnifiedRepository mockRepo, String fileId) {
List<VersionSummary> list = versionListMap.get(fileId);
int i = 1;
for (VersionSummary sum : list) {
if (i < list.size()) {
verify(mockRepo, times(1)).deleteFileAtVersion(fileId, sum.getId());
}
i++;
}
}
Aggregations