/** * Returns the A feedLink element representing the feed for list items in this * page. * * @return A feedLink element representing the feed for list items in this * page */ public FeedLink getFeedLink() { return getExtension(FeedLink.class); }
/** * Returns the parent sites link. * * @return Parent sites link or {@code null} for none. */ public Link getParentLink() { return getLink(SitesLink.Rel.PARENT, Link.Type.ATOM); }
/** * Returns whether it has the A feedLink element representing the feed for * list items in this page. * * @return whether it has the A feedLink element representing the feed for * list items in this page */ public boolean hasFeedLink() { return hasExtension(FeedLink.class); }
/** * Sets the data region of a table. * * @param data data region of a table or <code>null</code> to reset */ public void setData(Data data) { if (data == null) { removeExtension(Data.class); } else { setExtension(data); } }
/** * Declare the extensions of the feeds for the Google Sites Data API. */ private void declareExtensions() { 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); }
entry = new ListItemEntry(); } else if (hasClass(element, "listpage")) { entry = new ListPageEntry(); } else if (hasClass(element, "webattachment")) { entry = new WebAttachmentEntry();
/** * Default mutable constructor. */ public ListPageEntry() { super(); getCategories().add(CATEGORY); }
Data data = listPage.getData(); Map<String, String> names = Maps.newHashMap(); for (Column column : data.getColumns()) {
/** * Sets the header row. * * @param header header row or <code>null</code> to reset */ public void setHeader(Header header) { if (header == null) { removeExtension(Header.class); } else { setExtension(header); } }
/** * 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); }
/** * Default mutable constructor. */ public ListPageEntry() { super(); getCategories().add(CATEGORY); }
@Override public XmlElement renderList(ListPageEntry entry, @Nullable List<ListItemEntry> listItems) { XmlElement table = new XmlElement("table").setAttribute("border", "1"); XmlElement header = new XmlElement("tr").setAttribute("class", "gs:data"); for (Column col : entry.getData().getColumns()) { XmlElement cell = new XmlElement("th"); cell.setAttribute("class", "gs:column"); cell.setAttribute("title", col.getIndex()); cell.addText(col.getName()); header.addElement(cell); } XmlElement authorCell = new XmlElement("th"); header.addElement(authorCell.addText("Author")); XmlElement updatedCell = new XmlElement("th"); header.addElement(updatedCell.addText("Updated")); XmlElement revisionCell = new XmlElement("th"); header.addElement(revisionCell.addText("Version")); table.addElement(header); if (listItems != null) { for (ListItemEntry item : listItems) { table.addElement(getRow(item)); } } return table; }
/** * Sets the header row. * * @param header header row or <code>null</code> to reset */ public void setHeader(Header header) { if (header == null) { removeExtension(Header.class); } else { setExtension(header); } }
/** * Returns the attachments sites link. * * @return Attachments sites link or {@code null} for none. */ public Link getAtomAttachmentsLink() { return getLink(SitesLink.Rel.ATTACHMENTS, Link.Type.ATOM); }
/** * Returns the header row. * * @return header row */ public Header getHeader() { return getExtension(Header.class); }
/** * Returns whether it has the worksheet where the table lives. * * @return whether it has the worksheet where the table lives */ public boolean hasWorksheet() { return hasExtension(Worksheet.class); }
/** * Sets the data region of a table. * * @param data data region of a table or <code>null</code> to reset */ public void setData(Data data) { if (data == null) { removeExtension(Data.class); } else { setExtension(data); } }
/** * Returns the replies sites link. * * @return Replies sites link or {@code null} for none. */ public Link getAtomRepliesLink() { return getLink(SitesLink.Rel.REPLIES, Link.Type.ATOM); }
/** * Returns the data region of a table. * * @return data region of a table */ public Data getData() { return getExtension(Data.class); }
/** * Returns whether it has the data region of a table. * * @return whether it has the data region of a table */ public boolean hasData() { return hasExtension(Data.class); }