Example usage for org.apache.commons.collections.map ListOrderedMap asList

List of usage examples for org.apache.commons.collections.map ListOrderedMap asList

Introduction

In this page you can find the example usage for org.apache.commons.collections.map ListOrderedMap asList.

Prototype

public List asList() 

Source Link

Document

Gets an unmodifiable List view of the keys which changes as the map changes.

Usage

From source file:controllers.require.RequireApp.java

/**
 * /*from   w w  w. ja  v a 2  s .  co  m*/
 */
@Transactional(readOnly = true)
public static Result index() {
    DynamicForm requestData = Form.form().bindFromRequest();
    ListOrderedMap cts = SkillTag.getCacheCategory();
    Integer page = StringUtils.isBlank(requestData.get("page")) ? 1 : new Integer(requestData.get("page"));
    Integer pageSize = StringUtils.isBlank(requestData.get("pageSize")) ? 10
            : new Integer(requestData.get("pageSize"));
    Long categoryId = StringUtils.isBlank(requestData.get("categoryId")) ? (Long) cts.asList().get(0)
            : new Long(requestData.get("categoryId"));
    String type = requestData.get("type") == null ? "html" : requestData.get("type");
    Page<RequireListVO> returnPage = Require.queryRequireByPage(page, pageSize, categoryId);
    if (!type.equals("json")) {
        return ok(views.html.require.index.render(returnPage, cts, categoryId));
    }
    return ok(play.libs.Json.toJson(returnPage));
}

From source file:controllers.services.ServicesApp.java

/**
 * ?//from w  w  w . j  a  va 2  s  .c o m
 */
@Transactional(readOnly = true)
public static Result index() {
    DynamicForm requestData = Form.form().bindFromRequest();
    ListOrderedMap cts = SkillTag.getCacheCategory();
    Integer page = StringUtils.isBlank(requestData.get("page")) ? 1 : new Integer(requestData.get("page"));
    Integer pageSize = StringUtils.isBlank(requestData.get("pageSize")) ? 10
            : new Integer(requestData.get("pageSize"));
    Long categoryId = StringUtils.isBlank(requestData.get("categoryId")) ? (Long) cts.asList().get(0)
            : new Long(requestData.get("categoryId"));
    String type = requestData.get("type") == null ? "html" : requestData.get("type");
    Page<ServiceListVO> returnPage = Service.queryServiceByPage(page, pageSize, categoryId);
    if (!type.equals("json")) {
        return ok(views.html.services.index.render(returnPage, cts, categoryId));
    }
    return ok(play.libs.Json.toJson(returnPage));
}

From source file:org.cesecore.config.ExtendedKeyUsageConfiguration.java

/**
 * Fill the map and list with OIDs from the configuration file
 *///  ww w  .j a  va  2  s.co m
@SuppressWarnings("unchecked")
private static synchronized void fillExtendedKeyUsageOidsAndTexts() {
    final ListOrderedMap map = new ListOrderedMap();
    final Configuration conf = ConfigurationHolder.instance();
    final String ekuname = "extendedkeyusage.name.";
    final String ekuoid = "extendedkeyusage.oid.";
    for (int i = 0; i < 255; i++) {
        final String oid = conf.getString(ekuoid + i);
        if (oid != null) {
            String name = conf.getString(ekuname + i);
            if (name != null) {
                // A null value in the properties file means that we should not use this value, so set it to null for real
                if (name.equalsIgnoreCase("null")) {
                    name = null;
                } else {
                    map.put(oid, name);
                }
            } else {
                log.error("Found extended key usage oid " + oid
                        + ", but no name defined. Not adding to list of extended key usages.");
            }
        }
        // No eku with a certain number == continue trying next, we will try 0-255.
    }
    log.debug("Read " + map.size() + " extended key usages.");
    extendedKeyUsageOids = map.asList();
    if ((extendedKeyUsageOids == null) || (extendedKeyUsageOids.size() == 0)) {
        log.error(
                "Extended key usage OIDs is null or zero length, there is a serious error with extendedkeyusage.properties");
        extendedKeyUsageOids = new ArrayList<String>();
    }
    extendedKeyUsageOidsAndNames = Collections.synchronizedMap(map);
}

From source file:org.ejbca.config.ExtendedKeyUsageConfiguration.java

/**
 * Fill the map and list with OIDs from the configuration file
 */// w  w w .ja  v a 2s  .c o m
private static synchronized void fillExtendedKeyUsageOidsAndTexts() {
    final ListOrderedMap map = new ListOrderedMap();
    final Configuration conf = ConfigurationHolder.instance();
    final String ekuname = "extendedkeyusage.name.";
    final String ekuoid = "extendedkeyusage.oid.";
    for (int i = 0; i < 255; i++) {
        final String oid = conf.getString(ekuoid + i);
        if (oid != null) {
            String name = conf.getString(ekuname + i);
            if (name != null) {
                // A null value in the properties file means that we should not use this value, so set it to null for real
                if (name.equalsIgnoreCase("null")) {
                    name = null;
                }
                map.put(oid, name);
            } else {
                log.error("Found extended key usage oid " + oid
                        + ", but no name defined. Not adding to list of extended key usages.");
            }
        } else {
            // No eku with that number = no more ekus so break,
            log.debug("Read " + i + " extended key usages.");
            break;
        }
    }
    extendedKeyUsageOids = map.asList();
    if (extendedKeyUsageOids == null) {
        log.error("Extended key usage OIDs is null, there is a serious error with extendedkeyusage.properties");
        extendedKeyUsageOids = new ArrayList<String>();
    }
    extendedKeyUsageOidsAndNames = Collections.synchronizedMap(map);
}