Search in sources :

Example 6 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class SearchDialog method viewTree.

protected void viewTree() {
    FeedEntryModel entry = getSelectedSyndicatedEntry();
    Utils.browse(entry.link.replace("/commit/", "/tree/"));
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 7 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class FeedsPanel method viewCommitDiff.

protected void viewCommitDiff() {
    FeedEntryModel entry = getSelectedSyndicatedEntry();
    Utils.browse(entry.link.replace("/commit/", "/commitdiff/"));
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 8 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class FeedsPanel method updateAuthors.

private void updateAuthors() {
    String repository = ALL;
    if (repositorySelector.getSelectedIndex() > -1) {
        repository = repositorySelector.getSelectedItem().toString();
    }
    // determine unique repositories and authors
    Set<String> uniqueAuthors = new HashSet<String>();
    for (FeedEntryModel entry : tableModel.entries) {
        if (repository.equals(ALL) || entry.repository.equalsIgnoreCase(repository)) {
            uniqueAuthors.add(entry.author);
        }
    }
    // authors
    List<String> sortedAuthors = new ArrayList<String>(uniqueAuthors);
    Collections.sort(sortedAuthors);
    authorChoices.removeAllElements();
    authorChoices.addElement(ALL);
    for (String author : sortedAuthors) {
        authorChoices.addElement(author);
    }
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Example 9 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class GitblitClient method refreshSubscribedFeeds.

public List<FeedEntryModel> refreshSubscribedFeeds(int page) throws IOException {
    Set<FeedEntryModel> allEntries = new HashSet<FeedEntryModel>();
    if (reg.feeds.size() > 0) {
        for (FeedModel feed : reg.feeds) {
            feed.lastRefreshDate = feed.currentRefreshDate;
            feed.currentRefreshDate = new Date();
            List<FeedEntryModel> entries = SyndicationUtils.readFeed(url, feed.repository, feed.branch, -1, page, account, password);
            allEntries.addAll(entries);
        }
    }
    reg.cacheFeeds();
    syndicatedEntries.clear();
    syndicatedEntries.addAll(allEntries);
    Collections.sort(syndicatedEntries);
    return syndicatedEntries;
}
Also used : FeedModel(com.gitblit.models.FeedModel) FeedEntryModel(com.gitblit.models.FeedEntryModel) Date(java.util.Date) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Example 10 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class FeedEntryTableModel method getValueAt.

@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    FeedEntryModel entry = entries.get(rowIndex);
    Columns col = Columns.values()[columnIndex];
    switch(col) {
        case Date:
            return entry.published;
        case Repository:
            return entry.repository;
        case Branch:
            return entry.branch;
        case Author:
            return entry.author;
        case Message:
            return entry;
    }
    return null;
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Aggregations

FeedEntryModel (com.gitblit.models.FeedEntryModel)19 ArrayList (java.util.ArrayList)6 HashSet (java.util.HashSet)5 Test (org.junit.Test)3 SyndCategory (com.sun.syndication.feed.synd.SyndCategory)2 SyndEntryImpl (com.sun.syndication.feed.synd.SyndEntryImpl)2 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)2 Date (java.util.Date)2 Constants (com.gitblit.Constants)1 GitBlitException (com.gitblit.GitBlitException)1 FeedModel (com.gitblit.models.FeedModel)1 ProjectModel (com.gitblit.models.ProjectModel)1 RefModel (com.gitblit.models.RefModel)1 RepositoryModel (com.gitblit.models.RepositoryModel)1 UserModel (com.gitblit.models.UserModel)1 AuthenticatedRequest (com.gitblit.servlet.AuthenticationFilter.AuthenticatedRequest)1 BugtraqProcessor (com.gitblit.utils.BugtraqProcessor)1 SyndCategoryImpl (com.sun.syndication.feed.synd.SyndCategoryImpl)1 SyndContent (com.sun.syndication.feed.synd.SyndContent)1 SyndContentImpl (com.sun.syndication.feed.synd.SyndContentImpl)1