@Override public List<LocalLink> wikify(int wpId, String text) throws DaoException { if (text == null || text.isEmpty()) { return new ArrayList<LocalLink>(); } List<LocalLink> links = new ArrayList<LocalLink>(); for (LocalLink ll : linkDao.getLinks(language, wpId, true)) { if (ll.getLocation() >= 0 && ll.isParseable() && !StringUtils.isNullOrEmpty(ll.getAnchorText())) { links.add(ll); } } Collections.sort(links); return align(links, text); }
private LocalLink cloneLinkWithLocation(LocalLink ll, int location) { return new LocalLink( ll.getLanguage(), ll.getAnchorText(), ll.getSourceId(), ll.getDestId(), ll.isOutlink(), location, ll.isParseable(), ll.getLocType() ); }
@Override public void save(LocalLink localLink) throws DaoException { insert( localLink.getLanguage().getId(), localLink.getAnchorText(), localLink.getSourceId(), localLink.getDestId(), localLink.getLocation(), localLink.isParseable(), localLink.getLocType().ordinal() ); }