AtomCollection(final AtomBlog blog, final ClientCollection col) { this.blog = blog; clientCollection = col; for (final Object element : col.getCategories()) { final Categories cats = (Categories) element; for (final Object element2 : cats.getCategories()) { final Category cat = (Category) element2; final BlogEntry.Category blogCat = new BlogEntry.Category(cat.getTerm()); blogCat.setName(cat.getLabel()); blogCat.setUrl(cat.getScheme()); getCategories().add(blogCat); } } }
if (cat.getScheme() != null && cat.getScheme().equals( RollerAtomService.getWeblogCategoryScheme(rollerEntry.getWebsite()))) { String catString = cat.getTerm(); if (catString != null) { WeblogCategory rollerCat = for (Category cat : categories) { if (cat.getScheme() == null) { buff.append(" ").append(cat.getTerm());
protected Element generateCategoryElement(final Category cat) { final Namespace namespace = getFeedNamespace(); final Element catElement = new Element("category", namespace); final String term = cat.getTerm(); if (term != null) { final Attribute termAttribute = new Attribute("term", term); catElement.setAttribute(termAttribute); } final String label = cat.getLabel(); if (label != null) { final Attribute labelAttribute = new Attribute("label", label); catElement.setAttribute(labelAttribute); } final String scheme = cat.getScheme(); if (scheme != null) { final Attribute schemeAttribute = new Attribute("scheme", scheme); catElement.setAttribute(schemeAttribute); } return catElement; }
protected Element generateCategoryElement(final Category cat) { final Namespace namespace = getFeedNamespace(); final Element catElement = new Element("category", namespace); final String term = cat.getTerm(); if (term != null) { final Attribute termAttribute = new Attribute("term", term); catElement.setAttribute(termAttribute); } final String label = cat.getLabel(); if (label != null) { final Attribute labelAttribute = new Attribute("label", label); catElement.setAttribute(labelAttribute); } final String scheme = cat.getScheme(); if (scheme != null) { final Attribute schemeAttribute = new Attribute("scheme", scheme); catElement.setAttribute(schemeAttribute); } return catElement; }
for (final com.rometools.rome.feed.atom.Category romeCat : romeCats) { final BlogEntry.Category cat = new BlogEntry.Category(); cat.setId(romeCat.getTerm()); cat.setUrl(romeCat.getScheme()); cat.setName(romeCat.getLabel());
for (final Category category : categories) { final SyndCategory syndCategory = new SyndCategoryImpl(); syndCategory.setName(category.getTerm()); syndCategory.setTaxonomyUri(category.getSchemeResolved());
for (final Category category : categories) { final SyndCategory syndCategory = new SyndCategoryImpl(); syndCategory.setName(category.getTerm()); syndCategory.setTaxonomyUri(category.getSchemeResolved());
public Element categoriesToElement() { final Categories cats = this; final Element catsElem = new Element("categories", AtomService.ATOM_PROTOCOL); catsElem.setAttribute("fixed", cats.isFixed() ? "yes" : "no", AtomService.ATOM_PROTOCOL); if (cats.getScheme() != null) { catsElem.setAttribute("scheme", cats.getScheme(), AtomService.ATOM_PROTOCOL); } if (cats.getHref() != null) { catsElem.setAttribute("href", cats.getHref(), AtomService.ATOM_PROTOCOL); } else { // Loop to create <atom:category> elements for (final Object element : cats.getCategories()) { final Category cat = (Category) element; final Element catElem = new Element("category", AtomService.ATOM_FORMAT); catElem.setAttribute("term", cat.getTerm(), AtomService.ATOM_FORMAT); if (cat.getScheme() != null) { // optional catElem.setAttribute("scheme", cat.getScheme(), AtomService.ATOM_FORMAT); } if (cat.getLabel() != null) { // optional catElem.setAttribute("label", cat.getLabel(), AtomService.ATOM_FORMAT); } catsElem.addContent(catElem); } } return catsElem; }