use of com.revolsys.collection.map.MapEx 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;
}
use of com.revolsys.collection.map.MapEx 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;
}
use of com.revolsys.collection.map.MapEx 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;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class RecordDefinitionImpl method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "recordDefinition");
final String path = getPath();
map.put("path", path);
final ClockDirection polygonRingDirection = getPolygonRingDirection();
addToMap(map, "polygonRingDirection", polygonRingDirection, null);
final GeometryFactory geometryFactory = getGeometryFactory();
addToMap(map, "geometryFactory", geometryFactory, null);
final List<FieldDefinition> fields = getFields();
addToMap(map, "fields", fields);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class FieldDefinition method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "field");
map.put("name", getName());
map.put("title", getTitle());
addToMap(map, "description", getDescription(), "");
map.put("dataType", getDataType().getName());
map.put("length", getLength());
map.put("scale", getScale());
map.put("required", isRequired());
addToMap(map, "minValue", getMinValue(), null);
addToMap(map, "maxValue", getMaxValue(), null);
addToMap(map, "defaultValue", getDefaultValue(), null);
addToMap(map, "allowedValues", getAllowedValues(), Collections.emptyMap());
return map;
}
Aggregations