public ParameterMappingDefaultValue(String name, boolean forcible, String defaultValue) { setParameterName(name); setForcible(forcible); setDefaultValue(defaultValue); }
@Override public Object evaluate(Object object) { ParameterMappingContext contextObj = (ParameterMappingContext) object; return get(contextObj); }
public ParameterMappingExpressionValue(String name, String language, String expression) { setParameterName(name); setExpressionLanguage(language); setExpression(expression); }
public ParameterMapping getStoredQueryParameterMapping(String parameterName) { ParameterMapping ret = null; if (this.config == null || this.config.getStoredQueryParameterMappings() == null) { return ret; } for (ParameterMapping sqpm : this.config.getStoredQueryParameterMappings()) { if (sqpm.getParameterName().equals(parameterName)) { ret = sqpm; break; } } return ret; }
protected String evaluateMapping( ParameterMappingContext mappingContext, ParameterMapping mapping) { String value; if (mapping instanceof ParameterMappingDefaultValue) { value = ((ParameterMappingDefaultValue) mapping).getDefaultValue(); } else if (mapping instanceof ParameterMappingExpressionValue) { value = ((ParameterMappingExpressionValue) mapping).evaluate(mappingContext); } else if (mapping instanceof ParameterMappingBlockValue) { value = null; } else { throw new IllegalArgumentException( "Unknown StoredQueryParameterMapping: " + mapping.getClass()); } return value; } }
new ParameterMappingContext(filter, viewParams, featureTypeInfo); String value = null; ParameterMapping mapping = getStoredQueryParameterMapping(parameter.getName()); if (mapping != null && mapping.isForcible()) { value = evaluateMapping(mappingContext, mapping); value = evaluateMapping(mappingContext, mapping);
new ParameterTypeFactory(config, desc, featureTypeInfo) .buildStoredQueryParameters(viewParams, originalFilter);
@Override public boolean initialize( FeatureTypeInfo info, DataAccess<? extends FeatureType, ? extends Feature> dataAccess, Name temporaryName) throws IOException { StoredQueryConfiguration sqc = info.getMetadata() .get( FeatureTypeInfo.STORED_QUERY_CONFIGURATION, StoredQueryConfiguration.class); WFSDataStore wstore = (WFSDataStore) dataAccess; String localPart = info.getName(); boolean usesTemporary = false; if (temporaryName != null) { localPart = temporaryName.getLocalPart(); usesTemporary = true; } if (!wstore.getConfiguredStoredQueries().containsValue(localPart)) { wstore.addStoredQuery(localPart, sqc.getStoredQueryId()); } return usesTemporary; }
@Override protected Object get(ParameterMappingContext context) { return context.getBBOX().getMaxY(); } });
public ParameterMappingBlockValue(String name) { setParameterName(name); }
@Override protected Object get(ParameterMappingContext context) { return context.getViewParams().get(paramName); } };
@Override protected Object get(ParameterMappingContext context) { return context.getFeatureTypeInfo().getDefaultSRS(); } });
private Expression ensureExpression() { if (cqlExpression != null) return cqlExpression; try { cqlExpression = CQL.toExpression(expression, new ParameterCQLExpressionFilterFactoryImpl()); } catch (CQLException ce) { throw new IllegalArgumentException("Illegal CQL expression", ce); } return cqlExpression; }
public String evaluate(ParameterMappingContext mappingContext) { Object obj = ensureExpression().evaluate(mappingContext); String ret; if (obj == null) { ret = null; } else if (obj instanceof String) { ret = (String) obj; } else { ret = obj.toString(); } return ret; } }
properties.put(p.getPropertyName(), p);
new ParameterTypeFactory(config, desc, featureTypeInfo) .buildStoredQueryParameters(viewParams, query.getFilter());
@Override protected Object get(ParameterMappingContext context) { return context.getBBOX().getMinX(); } });
@Override public <T> T evaluate(Object object, Class<T> context) { ParameterMappingContext contextObj = (ParameterMappingContext) object; return (T) get(contextObj); }
@Override protected Object get(ParameterMappingContext context) { return context.getBBOX().getMaxX(); } });
@Override protected Object get(ParameterMappingContext context) { return context.getBBOX().getMinY(); } });