use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class SwaggerWebServices method getSwapperUi.
/**
* Return a swagger static resources.
* @param resourceUrl Resource name
* @param response HttpResponse
* @throws IOException Exception
*/
@SessionLess
@AnonymousAccessAllowed
@GET("/swaggerUi/{resourceUrl}")
public void getSwapperUi(@PathParam("resourceUrl") final String resourceUrl, final HttpServletResponse response) throws IOException {
FileUtil.checkUserFileName(resourceUrl);
// ----
if (resourceUrl.isEmpty()) {
response.sendRedirect("./index.html");
}
final URL url = SwaggerWebServices.class.getResource("/swagger-site/" + resourceUrl);
sendFile(url, resolveContentType(resourceUrl), response, resourceUrl);
}
use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class ComponentCmdWebServices method getModuleConfig.
@AnonymousAccessAllowed
@GET("/vertigo/components/modules/{moduleName}")
public String getModuleConfig(@PathParam("moduleName") final String moduleName) {
Assertion.checkArgNotEmpty(moduleName);
// -----
final JsonArray jsonModuleConfigs = doGetModuleConfigs();
for (int i = 0; i < jsonModuleConfigs.size(); i++) {
final JsonObject jsonModuleConfig = (JsonObject) jsonModuleConfigs.get(i);
if (moduleName.equalsIgnoreCase(jsonModuleConfig.get("name").getAsString())) {
return jsonEngine.toJson(jsonModuleConfig);
}
}
throw new VSystemException("NotFoundException");
}
use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class AdvancedTestWebServices method testExportContacts.
@GET("/export/pdf/")
public VFile testExportContacts() throws URISyntaxException {
final URL tempFile = resourcetManager.resolve("io/vertigo/vega/webservice/data/ws/contacts.pdf");
final VFile result = fileManager.createFile(new File(tempFile.toURI()));
// 200
return result;
}
use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class ContactsWebServices method readContactView.
@GET("/contactView/{conId}")
public ContactView readContactView(@PathParam("conId") final long conId) {
final Contact contact = contactDao.get(conId);
if (contact == null) {
// 404 ?
throw new VUserException("Contact #" + conId + " unknown");
}
// we sheet and use 3 times the same address.
final DtList<Address> addresses = DtList.of(contact.getAddressAccessor().get(), contact.getAddressAccessor().get(), contact.getAddressAccessor().get());
final ContactView contactView = new ContactView();
contactView.setName(contact.getName());
contactView.setFirstName(contact.getFirstName());
contactView.setHonorificCode(contact.getHonorificCode());
contactView.setEmail(contact.getEmail());
contactView.setBirthday(contact.getBirthday());
contactView.setAddresses(addresses);
// 200
return contactView;
}
use of io.vertigo.vega.webservice.stereotype.GET in project vertigo by KleeGroup.
the class SimplerTestWebServices method loadListMeta.
@GET("/dtListMeta")
public DtList<Contact> loadListMeta() {
final DtList<Contact> result = new DtList<>(Contact.class);
for (final Contact contact : contactDao.getList()) {
result.add(contact);
}
result.setMetaData("testLong", 12);
result.setMetaData("testString", "the String test");
result.setMetaData("testDate", DateUtil.newDate());
result.setMetaData("testEscapedString", "the EscapedString \",} test");
return result;
}
Aggregations