/** * Get list of one Categories object containing categories allowed by collection. * * @param inline True if Categories object should contain collection of in-line Categories * objects or false if it should set the Href for out-of-line categories. */ public List<Categories> getCategories(final boolean inline) { final Categories cats = new Categories(); cats.setFixed(true); cats.setScheme(contextURI + "/" + handle + "/" + singular); if (inline) { for (final String catName : catNames) { final Category cat = new Category(); cat.setTerm(catName); cats.addCategory(cat); } } else { cats.setHref(getCategoriesURI()); } return Collections.singletonList(cats); }
for (final Category cat : categories) { final com.rometools.rome.feed.atom.Category romeCategory = new com.rometools.rome.feed.atom.Category(); romeCategory.setTerm(cat.getId()); romeCategory.setScheme(cat.getUrl()); romeCategory.setLabel(cat.getName());
private Category parseCategory(final String baseURI, final Element eCategory) { final Category category = new Category(); final String term = getAttributeValue(eCategory, "term"); if (term != null) { category.setTerm(term); } final String scheme = getAttributeValue(eCategory, "scheme"); if (scheme != null) { category.setScheme(scheme); if (isRelativeURI(scheme)) { category.setSchemeResolved(resolveURI(baseURI, eCategory, scheme)); } } final String label = getAttributeValue(eCategory, "label"); if (label != null) { category.setLabel(label); } return category; }
private Category parseCategory(final String baseURI, final Element eCategory) { final Category category = new Category(); final String term = getAttributeValue(eCategory, "term"); if (term != null) { category.setTerm(term); } final String scheme = getAttributeValue(eCategory, "scheme"); if (scheme != null) { category.setScheme(scheme); if (isRelativeURI(scheme)) { category.setSchemeResolved(resolveURI(baseURI, eCategory, scheme)); } } final String label = getAttributeValue(eCategory, "label"); if (label != null) { category.setLabel(label); } return category; }
Category atomCat = new Category(); atomCat.setScheme(RollerAtomService.getWeblogCategoryScheme(entry.getWebsite())); atomCat.setTerm(entry.getCategory().getName()); categories.add(atomCat); for (WeblogEntryTag tag : tmp) { Category newcat = new Category(); newcat.setTerm(tag.getName()); categories.add(newcat);
protected void parseCategoriesElement(final Element catsElem) { if (catsElem.getAttribute("href", AtomService.ATOM_PROTOCOL) != null) { setHref(catsElem.getAttribute("href", AtomService.ATOM_PROTOCOL).getValue()); } if (catsElem.getAttribute("fixed", AtomService.ATOM_PROTOCOL) != null) { if ("yes".equals(catsElem.getAttribute("fixed", AtomService.ATOM_PROTOCOL).getValue())) { setFixed(true); } } if (catsElem.getAttribute("scheme", AtomService.ATOM_PROTOCOL) != null) { setScheme(catsElem.getAttribute("scheme", AtomService.ATOM_PROTOCOL).getValue()); } // Loop to parse <atom:category> elemenents to Category objects final List<Element> catElems = catsElem.getChildren("category", AtomService.ATOM_FORMAT); for (final Element catElem : catElems) { final Category cat = new Category(); cat.setTerm(catElem.getAttributeValue("term", AtomService.ATOM_FORMAT)); cat.setLabel(catElem.getAttributeValue("label", AtomService.ATOM_FORMAT)); cat.setScheme(catElem.getAttributeValue("scheme", AtomService.ATOM_FORMAT)); addCategory(cat); } }
for (final SyndCategory sCat : sCats) { final Category aCat = new Category(); aCat.setTerm(sCat.getName());
for (final SyndCategory sCat : sCats) { final Category aCat = new Category(); aCat.setTerm(sCat.getName());
for (final SyndCategory sCat : sCats) { final Category aCat = new Category(); aCat.setTerm(sCat.getName());
for (final SyndCategory sCat : sCats) { final Category aCat = new Category(); aCat.setTerm(sCat.getName());
for (WeblogCategory rollerCat : rollerCats) { Category cat = new Category(); cat.setTerm(rollerCat.getName()); cat.setLabel(rollerCat.getName()); cats.addCategory(cat);