/** * Adds a new field. * * @param field field */ public void addField(Field field) { getFields().add(field); }
/** * 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); }
/** * Default mutable constructor. */ public ListItemEntry() { super(); getCategories().add(CATEGORY); }
try { Map<String, String> values = Maps.newHashMap(); for (Field field : listItem.getFields()) { values.put(field.getIndex(), field.getValue()); String parentId = listItem.getLink(SitesLink.Rel.PARENT, ILink.Type.ATOM) .getHref(); query.setParent(parentId.substring(parentId.lastIndexOf('/') + 1)); if (item.getFields().size() == listItem.getFields().size()) { boolean equal = true; for (Field field : item.getFields()) { if (!values.get(field.getIndex()).equals(field.getValue())) { equal = false;
/** * 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 FileCabinetPageEntry(); } else if (hasClass(element, "listitem")) { entry = new ListItemEntry(); } else if (hasClass(element, "listpage")) { entry = new ListPageEntry();
/** * Returns the fields. * * @return fields */ public List<Field> getFields() { return getRepeatingExtension(Field.class); }
/** * Returns whether it has the fields. * * @return whether it has the fields */ public boolean hasFields() { return hasRepeatingExtension(Field.class); }
((ListItemEntry) (BaseContentEntry) entry).addField(fieldParser.parseField(child));
/** * 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); }
/** * Returns the fields. * * @return fields */ public List<Field> getFields() { return getRepeatingExtension(Field.class); }
/** * Returns whether it has the fields. * * @return whether it has the fields */ public boolean hasFields() { return hasRepeatingExtension(Field.class); }
/** * Adds a new field. * * @param field field */ public void addField(Field field) { getFields().add(field); }
/** * 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); }
/** * Default mutable constructor. */ public ListItemEntry() { super(); getCategories().add(CATEGORY); }
names.put(column.getIndex(), column.getName()); for (Field field : listItem.getFields()) { String name = names.get(field.getIndex()); field.setName(name);
private XmlElement getRow(ListItemEntry item) { XmlElement element = RendererUtils.getEntryElement(item, "tr"); for (Field field : item.getFields()) { String val; if (field.getValue() == null || field.getValue().equals("")) { val = " "; //Equivalent to but XML compliant } else if (field.getValue().equals("on")) { val = "\u2713"; //Checkmark } else { val = field.getValue(); } XmlElement cell = new XmlElement("td"); cell.setAttribute("class", "gs:field"); cell.setAttribute("title", field.getIndex()); cell.addXml(val); element.addElement(cell); } XmlElement authorCell = new XmlElement("td"); element.addElement(authorCell.addElement( RendererUtils.getAuthorElement(item))); XmlElement revisionCell = new XmlElement("td"); XmlElement updatedCell = new XmlElement("td"); element.addElement(updatedCell.addElement( RendererUtils.getUpdatedElement(item))); element.addElement(revisionCell.addElement( RendererUtils.getRevisionElement(item))); return element; } }