Search in sources :

Example 1 with DomConfigurator

use of org.glassfish.admin.rest.utils.DomConfigurator in project Payara by payara.

the class BaseProvider method getResourceLinks.

protected Map<String, String> getResourceLinks(List<Dom> proxyList) {
    Map<String, String> links = new TreeMap<String, String>();
    Collections.sort(proxyList, new DomConfigurator());
    for (Dom proxy : proxyList) {
        // for each element
        try {
            links.put(proxy.getKey(), getElementLink(uriInfo.get(), proxy.getKey()));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    return links;
}
Also used : Dom(org.jvnet.hk2.config.Dom) DomConfigurator(org.glassfish.admin.rest.utils.DomConfigurator) TreeMap(java.util.TreeMap) IOException(java.io.IOException) WebApplicationException(javax.ws.rs.WebApplicationException)

Example 2 with DomConfigurator

use of org.glassfish.admin.rest.utils.DomConfigurator in project Payara by payara.

the class GetResultListHtmlProvider method getResourcesLinks.

private String getResourcesLinks(List<Dom> proxyList) {
    StringBuilder result = new StringBuilder("<div>");
    Collections.sort(proxyList, new DomConfigurator());
    for (Map.Entry<String, String> link : getResourceLinks(proxyList).entrySet()) {
        result.append("<a href=\"").append(link.getValue()).append("\">").append(link.getKey()).append("</a><br>");
    }
    result.append("</div><br/>");
    return result.toString();
}
Also used : DomConfigurator(org.glassfish.admin.rest.utils.DomConfigurator) Map(java.util.Map)

Aggregations

DomConfigurator (org.glassfish.admin.rest.utils.DomConfigurator)2 IOException (java.io.IOException)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 Dom (org.jvnet.hk2.config.Dom)1