Search in sources :

Example 6 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class MavenPom method getPomProperties.

@Override
public MapEx getPomProperties() {
    if (this.pomProperties == null) {
        return MapEx.EMPTY;
    } else {
        if (this.mergedPomProperties == null) {
            final MapEx properties = new LinkedHashMapEx();
            final MavenPom parentPom = getParentPom();
            if (parentPom != null) {
                final MapEx parentProperties = parentPom.getPomProperties();
                properties.putAll(parentProperties);
            }
            properties.putAll(this.pomProperties);
            properties.put("project.artifactId", getArtifactId());
            properties.put("project.version", getVersion());
            properties.put("project.groupId", getGroupId());
            this.mergedPomProperties = properties;
        }
        return this.mergedPomProperties;
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 7 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class CsvMapIterator method parseMap.

private MapEx parseMap(final List<String> record) {
    final MapEx map = new LinkedHashMapEx();
    for (int i = 0; i < this.fieldNames.size() && i < record.size(); i++) {
        final String fieldName = this.fieldNames.get(i);
        final String value = record.get(i);
        if (value != null) {
            map.put(fieldName, value);
        }
    }
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 8 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class SpringExpresssionLanguageFilter method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    addTypeToMap(map, "queryFilter");
    map.put("query", this.query);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 9 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class MapGuideWebService method getResource.

public Resource getResource(final String operation, final String format, final Map<String, ? extends Object> parameters) throws Error {
    final MapEx newParameters = new LinkedHashMapEx(parameters);
    newParameters.put("VERSION", "1.0.0");
    newParameters.put("OPERATION", operation);
    newParameters.put("format", format);
    final UrlResource serviceUrl = getServiceUrl();
    final UrlResource mapAgentUrl = serviceUrl.newChildResource("mapagent/mapagent.fcgi");
    final UrlResource resource = mapAgentUrl.newUrlResource(newParameters);
    return resource;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) UrlResource(com.revolsys.spring.resource.UrlResource) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 10 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class MapGuideWebService method getResources.

public Map<PathName, MapGuideResource> getResources(final String path) {
    final MapEx parameters = new LinkedHashMapEx();
    parameters.put("RESOURCEID", "Library:/" + path);
    parameters.put("COMPUTECHILDREN", "1");
    parameters.put("DEPTH", "-1");
    final MapEx response = getJsonResponse("ENUMERATERESOURCES", parameters);
    final MapEx resourceList = response.getValue("ResourceList");
    final List<MapEx> resourceFolders = resourceList.getValue("ResourceFolder");
    final Map<PathName, Folder> folderByPath = new HashMap<>();
    final Map<PathName, MapGuideResource> resourceByPath = new HashMap<>();
    for (final MapEx resourceDefinition : resourceFolders) {
        final Folder folder = new Folder(resourceDefinition);
        folder.setWebService(this);
        final PathName resourcePath = folder.getPath();
        folderByPath.put(resourcePath, folder);
        resourceByPath.put(resourcePath, folder);
        final PathName parentPath = resourcePath.getParent();
        if (parentPath != null) {
            final Folder parent = folderByPath.get(parentPath);
            parent.addResource(folder);
        }
    }
    final List<MapEx> resourceDocuments = resourceList.getValue("ResourceDocument");
    for (final MapEx resourceDefinition : resourceDocuments) {
        final List<String> resourceIdList = resourceDefinition.getValue("ResourceId");
        final String resourceId = resourceIdList.get(0);
        final String resourceType = resourceId.substring(resourceId.lastIndexOf(".") + 1);
        final Function<MapEx, ResourceDocument> factory = RESOURCE_DOCUMENT_FACTORIES.get(resourceType);
        if (factory != null) {
            final ResourceDocument resource = factory.apply(resourceDefinition);
            resource.setWebService(this);
            final PathName resourcePath = resource.getPath();
            resourceByPath.put(resourcePath, resource);
            final PathName parentPath = resourcePath.getParent();
            if (parentPath != null) {
                final Folder parent = folderByPath.get(parentPath);
                parent.addResource(resource);
            }
        } else {
            Logs.debug(this, "Unsupported resource type: " + resourceType);
        }
    }
    final Folder root = folderByPath.get(PathName.ROOT);
    if (root != null) {
        this.root = root;
    }
    return resourceByPath;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) HashMap(java.util.HashMap) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) PathName(com.revolsys.io.PathName)

Aggregations

LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)39 MapEx (com.revolsys.collection.map.MapEx)38 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 BoundingBox (com.revolsys.geometry.model.BoundingBox)2 UrlResource (com.revolsys.spring.resource.UrlResource)2 Component (java.awt.Component)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 PropertyChangeArrayList (com.revolsys.collection.PropertyChangeArrayList)1 MapSerializerMap (com.revolsys.collection.map.MapSerializerMap)1 LasPoint (com.revolsys.elevation.cloud.las.pointformat.LasPoint)1 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 ClockDirection (com.revolsys.geometry.model.ClockDirection)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 PathName (com.revolsys.io.PathName)1 Resource (com.revolsys.spring.resource.Resource)1 ValueField (com.revolsys.swing.component.ValueField)1 PasswordField (com.revolsys.swing.field.PasswordField)1