use of org.nuxeo.drive.service.impl.FileSystemItemChangeImpl in project nuxeo-drive-server by nuxeo.
the class MockChangeFinder method getDocumentChanges.
protected List<FileSystemItemChange> getDocumentChanges(CoreSession session, String query, int limit) throws TooManyChangesException {
List<FileSystemItemChange> docChanges = new ArrayList<FileSystemItemChange>();
DocumentModelList queryResult = session.query(query, limit);
if (queryResult.size() >= limit) {
throw new TooManyChangesException("Too many document changes found in the repository.");
}
for (DocumentModel doc : queryResult) {
String repositoryId = session.getRepositoryName();
String eventId = "documentChanged";
long eventDate = ((Calendar) doc.getPropertyValue("dc:modified")).getTimeInMillis();
String docUuid = doc.getId();
FileSystemItem fsItem = doc.getAdapter(FileSystemItem.class);
if (fsItem != null) {
docChanges.add(new FileSystemItemChangeImpl(eventId, eventDate, repositoryId, docUuid, fsItem));
}
}
return docChanges;
}
Aggregations