本文整理汇总了Java中com.google.gdata.data.sites.AnnouncementsPageEntry类的典型用法代码示例。如果您正苦于以下问题:Java AnnouncementsPageEntry类的具体用法?Java AnnouncementsPageEntry怎么用?Java AnnouncementsPageEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnouncementsPageEntry类属于com.google.gdata.data.sites包,在下文中一共展示了AnnouncementsPageEntry类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetType
import com.google.gdata.data.sites.AnnouncementsPageEntry; //导入依赖的package包/类
@Test
public void testGetType() {
assertEquals(EntryType.getType(new AnnouncementEntry()),
EntryType.ANNOUNCEMENT);
assertEquals(EntryType.getType(new AnnouncementsPageEntry()),
EntryType.ANNOUNCEMENTS_PAGE);
assertEquals(EntryType.getType(new AttachmentEntry()),
EntryType.ATTACHMENT);
assertEquals(EntryType.getType(new CommentEntry()),
EntryType.COMMENT);
assertEquals(EntryType.getType(new FileCabinetPageEntry()),
EntryType.FILE_CABINET_PAGE);
assertEquals(EntryType.getType(new ListItemEntry()),
EntryType.LIST_ITEM);
assertEquals(EntryType.getType(new ListPageEntry()),
EntryType.LIST_PAGE);
assertEquals(EntryType.getType(new WebAttachmentEntry()),
EntryType.WEB_ATTACHMENT);
assertEquals(EntryType.getType(new WebPageEntry()),
EntryType.WEB_PAGE);
}
示例2: declareExtensions
import com.google.gdata.data.sites.AnnouncementsPageEntry; //导入依赖的package包/类
/**
* Declare the extensions of the feeds for the Google Sites Data API.
*/
private void declareExtensions() {
new AclFeed().declareExtensions(extProfile);
new SiteFeed().declareExtensions(extProfile);
/* Declarations for extensions that need to be handled as specific type
* should be done before call to {@see ExtensionProfile#setAutoExtending}.
* Order of declaration is important. */
extProfile.setAutoExtending(true);
new ActivityFeed().declareExtensions(extProfile);
new AnnouncementEntry().declareExtensions(extProfile);
new AnnouncementsPageEntry().declareExtensions(extProfile);
new AttachmentEntry().declareExtensions(extProfile);
new CommentEntry().declareExtensions(extProfile);
new ContentFeed().declareExtensions(extProfile);
new CreationActivityEntry().declareExtensions(extProfile);
new DeletionActivityEntry().declareExtensions(extProfile);
new EditActivityEntry().declareExtensions(extProfile);
new FileCabinetPageEntry().declareExtensions(extProfile);
new ListItemEntry().declareExtensions(extProfile);
new ListPageEntry().declareExtensions(extProfile);
new MoveActivityEntry().declareExtensions(extProfile);
new RecoveryActivityEntry().declareExtensions(extProfile);
new RevisionFeed().declareExtensions(extProfile);
new WebAttachmentEntry().declareExtensions(extProfile);
new WebPageEntry().declareExtensions(extProfile);
BatchUtils.declareExtensions(extProfile);
}
示例3: testIsPage
import com.google.gdata.data.sites.AnnouncementsPageEntry; //导入依赖的package包/类
@Test
public void testIsPage() {
assertTrue(EntryType.isPage(new AnnouncementEntry()));
assertTrue(EntryType.isPage(new AnnouncementsPageEntry()));
assertTrue(EntryType.isPage(new FileCabinetPageEntry()));
assertTrue(EntryType.isPage(new ListPageEntry()));
assertTrue(EntryType.isPage(new WebPageEntry()));
assertFalse(EntryType.isPage(new AttachmentEntry()));
assertFalse(EntryType.isPage(new CommentEntry()));
assertFalse(EntryType.isPage(new ListItemEntry()));
}
示例4: testAnnouncementsExport
import com.google.gdata.data.sites.AnnouncementsPageEntry; //导入依赖的package包/类
@Test
public void testAnnouncementsExport() throws IOException {
final AnnouncementsPageEntry entry = new AnnouncementsPageEntry();
entry.setId("entry");
entry.setTitle(new PlainTextConstruct("entry"));
final AnnouncementEntry announcement1 = new AnnouncementEntry();
announcement1.setId("announcement1");
announcement1.setUpdated(DateTime.parseDateTime("2009-08-06T16:08:12.107Z"));
EntryUtils.setParentId(announcement1, entry.getId());
final AnnouncementEntry announcement2 = new AnnouncementEntry();
announcement2.setId("attachment2");
announcement2.setUpdated(DateTime.parseDateTime("2009-08-06T16:26:57.019Z"));
EntryUtils.setParentId(announcement2, entry.getId());
entryStore.addEntry(entry);
entryStore.addEntry(announcement1);
entryStore.addEntry(announcement2);
final List<AnnouncementEntry> announcements = Lists.newArrayList();
announcements.add(announcement2);
announcements.add(announcement1);
context.checking(new Expectations() {{
oneOf (titleRenderer).renderTitle(entry);
will(returnValue(new XmlElement("div")));
oneOf (contentRenderer).renderContent(entry, true);
will(returnValue(new XmlElement("div")));
oneOf (announcementsRenderer).renderAnnouncements(
with(equal(announcements)));
will(returnValue(new XmlElement("div")));
}});
exporter.exportPage(entry, entryStore, out, true);
}