public virtual AtomFeed GetCollectionFeed(Id collectionId, int pageIndex)
    {
      LogService.Info("AtomPubService.GetCollectionFeed collectionId={0} pageIndex={1}", collectionId, pageIndex);
      Auth(collectionId, AuthAction.GetCollectionFeed);
      AppCollection c = AppServiceRepository.GetService().GetCollection(collectionId);
      EntryCriteria criteria = new EntryCriteria()
      {
        WorkspaceName = collectionId.Workspace,
        CollectionName = collectionId.Collection,
        Authorized = true,
        SortMethod = SortMethod.EditDesc //according to spec, collection feeds should be ordered by edited
      };
      int total;
      AtomFeed feed = AtomFeed.BuildFeed(c, AtomEntryRepository.GetEntries(criteria, pageIndex, c.PageSize, out total),
        total);//, pageIndex, c.PageSize, RouteFunc, "AtomPubCollection", "AtomPubCollectionIndex", true);
      SetLinks(feed);

      var url = new UrlHelper(Container.GetInstance<RequestContext>());
      feed.Links = feed.Links.Concat(url.GetPagingLinks("AtomPubCollection", feed.Id, null, feed.TotalResults ?? 0, pageIndex, c.PageSize,
        Atom.ContentTypeFeed, AbsoluteMode.Force));
      return feed;
    }
    public virtual AtomFeed GetFeed(Id collectionId, int pageIndex, int pageSize)
    {
      //<atom:link rel="alternate" type="text/html" href="https://atomsite.net/blog.xhtml" />

      LogService.Info("AtomPubService.GetFeed collectionId={0}", collectionId);
      Auth(collectionId, AuthAction.GetFeed);
      AppCollection c = AppServiceRepository.GetService().GetCollection(collectionId);
      EntryCriteria criteria = new EntryCriteria()
      {
        WorkspaceName = collectionId.Workspace,
        CollectionName = collectionId.Collection,
        Authorized = AuthorizeService.IsAuthorized(GetUser(), collectionId.ToScope(), AuthAction.GetEntryOrMedia),
      };
      int total;
      AtomFeed feed = AtomFeed.BuildFeed(c, AtomEntryRepository.GetEntries(criteria, pageIndex, pageSize, out total),
        total);//, pageIndex, pageSize, RouteFunc, "AtomPubFeed", "AtomPubCollectionIndex", true);

      var url = new UrlHelper(Container.GetInstance<RequestContext>());
      feed.Links = feed.Links.Concat(url.GetPagingLinks("AtomPubFeed", feed.Id, null, feed.TotalResults ?? 0, 
        pageIndex, pageSize,Atom.ContentTypeFeed, AbsoluteMode.Force));

      SetLinks(feed);
      return feed;
    }