String extension = user.getExtension(); if (StringUtils.isBlank(extension)) { continue;
Set aliases = user.getAliases(); boolean foundNumericAlias = false; Element item = null; for (Iterator iter = aliases.iterator(); iter.hasNext();) { String alias = (String) iter.next(); Matcher m = PATTERN_NUMERIC.matcher(alias); if (m.matches()) { if (!foundNumericAlias) {  item = items.addElement("item"); item.addElement("uri").setText(user.getUri(domainName)); foundNumericAlias = true; } item.addElement("extension").setText(alias); }
    protected void addItems(Element items) {        String domainName = getCoreContext().getDomainName();        List users = getCoreContext().loadUsers();        for (Iterator i = users.iterator(); i.hasNext();) {            User user = (User) i.next();            String extension = user.getExtension();            if (StringUtils.isBlank(extension)) {                continue;            }            Element item = items.addElement("item");            item.addElement("uri").setText(user.getUri(domainName));            item.addElement("extension").setText(extension);        }    }