本文整理匯總了Java中com.google.gdata.data.sites.AnnouncementEntry類的典型用法代碼示例。如果您正苦於以下問題:Java AnnouncementEntry類的具體用法?Java AnnouncementEntry怎麽用?Java AnnouncementEntry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AnnouncementEntry類屬於com.google.gdata.data.sites包,在下文中一共展示了AnnouncementEntry類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testGetType
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的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.AnnouncementEntry; //導入依賴的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: renderAnnouncements
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的package包/類
@Override
public XmlElement renderAnnouncements(
List<AnnouncementEntry> announcements) {
XmlElement div = new XmlElement("div");
for (AnnouncementEntry announcement : announcements) {
div.addElement(new XmlElement("hr"));
XmlElement announceDiv = RendererUtils.getEntryElement(announcement,
"blockquote");
XmlElement title = new XmlElement("b");
String href = announcement.getPageName().getValue() + "/index.html";
XmlElement titleLink = new XmlElement("a").addElement(
RendererUtils.getTitleElement(announcement));
titleLink.setAttribute("href", href);
title.addElement(titleLink);
announceDiv.addElement(title).addElement(new XmlElement("br"));
XmlElement info = new XmlElement("small");
XmlElement author = RendererUtils.getAuthorElement(announcement);
info.addText("posted by ").addElement(author);
XmlElement updated = RendererUtils.getUpdatedElement(announcement);
info.addText(" on ").addElement(updated);
announceDiv.addElement(info).addElement(new XmlElement("br"));
XmlElement mainHtml = RendererUtils.getXhtmlContentElement(announcement);
announceDiv.addElement(mainHtml);
div.addElement(announceDiv);
}
return div;
}
示例4: testGetEntryElement
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的package包/類
@Test
public void testGetEntryElement() {
BaseContentEntry<?> entry = new AnnouncementEntry();
entry.setId("announce");
XmlElement element = RendererUtils.getEntryElement(entry, "div");
assertEquals("<div class=\"hentry announcement\" id=\"announce\" />",
element.toString());
}
示例5: testIsPage
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的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()));
}
示例6: testAnnouncementsExport
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的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);
}
示例7: renderAnnouncements
import com.google.gdata.data.sites.AnnouncementEntry; //導入依賴的package包/類
/**
* Returns an XmlElement containing the given announcements, in the same order
* as they appear in the list.
*/
XmlElement renderAnnouncements(List<AnnouncementEntry> announcements);