use of io.vertigo.vega.webservice.data.domain.Contact in project vertigo by KleeGroup.
the class SearchTestWebServices method testFacetedQueryResult.
@POST("/facetedResult")
public FacetedQueryResult<Contact, DtList<Contact>> testFacetedQueryResult(final SelectedFacetValues selectedFacetValues) {
final DtList<Contact> allContacts = asDtList(contactDao.getList(), Contact.class);
final FacetedQueryDefinition facetedQueryDefinition = Home.getApp().getDefinitionSpace().resolve("QRY_CONTACT_FACET", FacetedQueryDefinition.class);
final FacetedQuery facetedQuery = new FacetedQuery(facetedQueryDefinition, selectedFacetValues);
return collectionsManager.facetList(allContacts, facetedQuery);
}
use of io.vertigo.vega.webservice.data.domain.Contact in project vertigo by KleeGroup.
the class AdvancedTestWebServices method testGetExtended.
@GET("/contactExtended/{conId}")
public ExtendedObject<Contact> testGetExtended(@PathParam("conId") final long conId) {
final Contact contact = contactDao.get(conId);
final ExtendedObject<Contact> result = new ExtendedObject<>(contact);
result.put("vanillaUnsupportedMultipleIds", new int[] { 1, 2, 3 });
// 200
return result;
}
use of io.vertigo.vega.webservice.data.domain.Contact 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.data.domain.Contact 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