use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class SimplerTestWebServices method testDate.
@GET("/dates")
public UiContext testDate(@QueryParam("date") final Date date) {
final UiContext result = new UiContext();
result.put("input", date);
result.put("inputAsString", date.toString());
return result;
}
use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class ComponentCmdWebServices method getComponentConfig.
@AnonymousAccessAllowed
@GET("/vertigo/components/{componentId}")
public String getComponentConfig(@PathParam("componentId") final String componentId) {
Assertion.checkArgNotEmpty(componentId);
// -----
final JsonArray jsonModuleConfigs = doGetModuleConfigs();
for (int i = 0; i < jsonModuleConfigs.size(); i++) {
final JsonObject jsonModuleConfig = (JsonObject) jsonModuleConfigs.get(i);
final JsonArray jsonComponentConfigs = jsonModuleConfig.get("componentConfigs").getAsJsonArray();
for (int j = 0; j < jsonComponentConfigs.size(); j++) {
final JsonObject jsonComponentConfig = (JsonObject) jsonComponentConfigs.get(j);
if (componentId.equalsIgnoreCase(jsonComponentConfig.get("id").getAsString())) {
return jsonEngine.toJson(jsonComponentConfig);
}
}
}
throw new VSystemException("NotFoundException");
}
Aggregations