Search in sources :

Example 11 with GET

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;
}
Also used : UiContext(io.vertigo.vega.engines.webservice.json.UiContext) GET(io.vertigo.vega.webservice.stereotype.GET)

Example 12 with GET

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");
}
Also used : JsonArray(com.google.gson.JsonArray) JsonObject(com.google.gson.JsonObject) VSystemException(io.vertigo.lang.VSystemException) GET(io.vertigo.vega.webservice.stereotype.GET) AnonymousAccessAllowed(io.vertigo.vega.webservice.stereotype.AnonymousAccessAllowed)

Aggregations

GET (io.vertigo.vega.webservice.stereotype.GET)12 AnonymousAccessAllowed (io.vertigo.vega.webservice.stereotype.AnonymousAccessAllowed)5 URL (java.net.URL)5 VFile (io.vertigo.dynamo.file.model.VFile)4 File (java.io.File)4 Contact (io.vertigo.vega.webservice.data.domain.Contact)3 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 VSystemException (io.vertigo.lang.VSystemException)2 SessionLess (io.vertigo.vega.webservice.stereotype.SessionLess)2 DtList (io.vertigo.dynamo.domain.model.DtList)1 VUserException (io.vertigo.lang.VUserException)1 UiContext (io.vertigo.vega.engines.webservice.json.UiContext)1 Address (io.vertigo.vega.webservice.data.domain.Address)1 ContactView (io.vertigo.vega.webservice.data.domain.ContactView)1 WebServiceDefinitionBuilder (io.vertigo.vega.webservice.metamodel.WebServiceDefinitionBuilder)1 WebServiceParam (io.vertigo.vega.webservice.metamodel.WebServiceParam)1 WebServiceParamType (io.vertigo.vega.webservice.metamodel.WebServiceParam.WebServiceParamType)1 ExtendedObject (io.vertigo.vega.webservice.model.ExtendedObject)1 AccessTokenConsume (io.vertigo.vega.webservice.stereotype.AccessTokenConsume)1