当前位置: 首页>>代码示例>>Java>>正文


Java Feed.setTitle方法代码示例

本文整理汇总了Java中org.apache.abdera.model.Feed.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Feed.setTitle方法的具体用法?Java Feed.setTitle怎么用?Java Feed.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.abdera.model.Feed的用法示例。


在下文中一共展示了Feed.setTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generate

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
public static String generate(List<SocialActivitiesEvent> eventTimeline,
                              String type) {
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();

    feed.setId("tag:org.uberfire,2014:/" + type);
    feed.setTitle("Social Activities Feed");
    feed.setUpdated(new Date());
    feed.addAuthor("Red Hat JBoss");

    for (SocialActivitiesEvent event : eventTimeline) {
        Entry entry = feed.addEntry();
        entry.setTitle(event.getType());
        entry.setSummary(event.getSocialUser().getUserName() + "  " + event.toString());
        entry.setUpdated(event.getTimestamp());
        entry.setPublished(event.getTimestamp());
    }
    return feed.toString();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:AtomSocialTimelineConverter.java

示例2: getGuestFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_ATOM_XML)
public Feed getGuestFeed(@Context UriInfo uriInfo) {
    Feed feed = abdera.newFeed();

    feed.setId("tag:koenighotze.org,2015:/guest");
    feed.setTitle("Guests");
    feed.setUpdated(new Date());

    final String baseUri = uriInfo.getBaseUri().toString();
    feed.addLink(baseUri + "feed", "self"); // todo self ref
    guestService.getAllGuests().stream().forEach(guest -> {
        Entry entry = feed.addEntry();
        entry.setId(guest.getId() + "");
        entry.setUpdated(from(guest.getLastUpdate().toInstant(UTC)));
        entry.setAttributeValue("Version", guest.getVersion() + "");
        entry.addLink(baseUri + "guests/" + guest.getPublicId());
    });

    return feed;
}
 
开发者ID:koenighotze,项目名称:Hotel-Reservation-Tool,代码行数:22,代码来源:GuestAtomFeed.java

示例3: createFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
protected Feed createFeed() {
  String feedTitle = config.getFeedTitle();
  String feedAuthor = config.getFeedAuthor();
  
  Feed feed = abdera.newFeed();
  feed.setId(config.getFeedUri());
  feed.setTitle(feedTitle == null ? "feed" : feedTitle);
  feed.setUpdated(new Date());
  feed.addAuthor(feedAuthor == null ? getServerName() : feedAuthor);

  return feed;
}
 
开发者ID:jyang,项目名称:google-feedserver,代码行数:13,代码来源:AbstractManagedCollectionAdapter.java

示例4: getFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@Override
public ResponseContext getFeed(final RequestContext request) {
	final Feed feed = this.abdera.newFeed();
	feed.setId(this.config.getServerConfiguration().getServerUri() + "/"
			+ this.config.getFeedId());
	feed.setTitle(this.config.getFeedTitle());
	feed.addAuthor(this.config.getFeedAuthor());
	feed.addLink(this.config.getFeedUri());
	feed.addLink(this.config.getFeedUri(), "self");
	feed.setUpdated(new Date());
	this.getEntries(request, feed, this.root);
	return ProviderHelper.returnBase(feed.getDocument(), 200, null);
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:14,代码来源:HackedFilesystemAdapter.java

示例5: listCollectionContents

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@Override
public Feed listCollectionContents(IRI iri, AuthCredentials authCredentials, SwordConfiguration swordConfiguration) throws SwordServerException, SwordAuthException, SwordError {
    AuthenticatedUser user = swordAuth.auth(authCredentials);
    user.setRequestMetadata(new UserRequestMetadata(request));
    urlManager.processUrl(iri.toString());
    String dvAlias = urlManager.getTargetIdentifier();
    if (urlManager.getTargetType().equals("dataverse") && dvAlias != null) {

        Dataverse dv = dataverseService.findByAlias(dvAlias);

        if (dv != null) {
            if (swordAuth.hasAccessToModifyDataverse(user, dv)) {
                Abdera abdera = new Abdera();
                Feed feed = abdera.newFeed();
                feed.setTitle(dv.getName());
                /**
                 * @todo For the supplied dataverse, should we should only
                 * the datasets that are *owned* by the user? Probably not!
                 * We should be using the permission system? Show the
                 * equivalent of datasets the user is "admin" on? What
                 * permission should we check?
                 *
                 * And should we only show datasets at the current level or
                 * should we show datasets that are in sub-dataverses as
                 * well?
                 */
                List childDvObjects = dataverseService.findByOwnerId(dv.getId());
                childDvObjects.addAll(datasetService.findByOwnerId(dv.getId()));
                List<Dataset> datasets = new ArrayList<>();
                for (Object object : childDvObjects) {
                    if (object instanceof Dataset) {
                        datasets.add((Dataset) object);
                    }
                }
                String baseUrl = urlManager.getHostnamePlusBaseUrlPath(iri.toString());
                for (Dataset dataset : datasets) {
                    String editUri = baseUrl + "/edit/study/" + dataset.getGlobalId();
                    String editMediaUri = baseUrl + "/edit-media/study/" + dataset.getGlobalId();
                    Entry entry = feed.addEntry();
                    entry.setId(editUri);
                    entry.setTitle(dataset.getLatestVersion().getTitle());
                    entry.setBaseUri(new IRI(editUri));
                    entry.addLink(editMediaUri, "edit-media");
                    feed.addEntry(entry);
                }
                Boolean dvHasBeenReleased = dv.isReleased();
                feed.addSimpleExtension(new QName(UriRegistry.SWORD_STATE, "dataverseHasBeenReleased"), dvHasBeenReleased.toString());
                return feed;
            } else {
                throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "user " + user.getDisplayInfo().getTitle() + " is not authorized to list datasets in dataverse " + dv.getAlias());
            }

        } else {
            throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Could not find dataverse: " + dvAlias);
        }
    } else {
        throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Couldn't determine target type or identifer from URL: " + iri);
    }
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:60,代码来源:CollectionListManagerImpl.java

示例6: getAllCommentRssFeeds

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_ATOM_XML)
@Path("comments")
public Feed getAllCommentRssFeeds(@Context UriInfo uriInfo) {

    Calendar cal = Calendar.getInstance();
    Date date = new Date();
    cal.setTime(date);

    Configuration conf = HibernateConfig.INSTANCE.getConnection(context);

    ServiceRegistryBuilder srb = new ServiceRegistryBuilder().applySettings(conf.getProperties());
    SessionFactory sf = conf.buildSessionFactory(srb.buildServiceRegistry());
    Session session = sf.openSession();

    Transaction tx = session.beginTransaction();

    @SuppressWarnings("unchecked")
    List<CommentaryEntity> queryResults = session.getNamedQuery("getAllCommentsOrderedByCreatedDesc").list();

    tx.commit();
    session.close();

    Feed feed = AbderaSupport.getAbdera().getFactory().newFeed();

    feed.setId("tag:localhost:8080," + cal.get(Calendar.YEAR) + ":/govdata/comments");
    feed.setTitle("GovData Kommentare zu Metadatenbeschreibungen");
    feed.setUpdated(date);
    feed.addAuthor("GovData.de");
    URI feedLink = uriInfo.getRequestUri();
    feed.addLink(feedLink.toString(), "self");

    int i = 1;
    for (CommentaryEntity comment : queryResults) {
        Entry entry = feed.addEntry();
        entry.setId("tag:localhost:8080," + cal.get(Calendar.YEAR) + ":/govdata/comments/entries" + i);
        entry.setTitle("Kommentar zu http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname());
        entry.setPublished(comment.getCreated());
        entry.setUpdated(comment.getCreated());
        entry.addAuthor(comment.getLiferayScreenName());
        entry.addLink(feedLink.toString(), "self");

        StringBuilder sb = new StringBuilder();
        sb.append("<div>");
        sb.append("<p>").append(comment.getText()).append("</p>");
        sb.append("<p>").append("Dieser Kommentar wurde erstellt von: " + comment.getLiferayScreenName()).append("</p>");
        sb.append("</div>");

        sb.append("<div>");
        sb.append("<a href=\"http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname()
                + "\">http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname() + "</a>");
        sb.append("</div>");

        entry.setContentAsHtml(sb.toString());

        i++;
    }

    return feed;
}
 
开发者ID:fraunhoferfokus,项目名称:odp-rss-servlet,代码行数:61,代码来源:RSSService.java


注:本文中的org.apache.abdera.model.Feed.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。