use of nikita.common.model.noark5.v4.hateoas.HateoasNoarkObject in project nikita-noark5-core by HiOA-ABI.
the class PrecedenceHateoasSerializer method serializeNoarkEntity.
@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject precedenceHateoas, JsonGenerator jgen) throws IOException {
Precedence precedence = (Precedence) noarkSystemIdEntity;
jgen.writeStartObject();
CommonUtils.Hateoas.Serialize.printPrecedence(jgen, precedence);
CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, precedenceHateoas.getLinks(precedence));
jgen.writeEndObject();
}
use of nikita.common.model.noark5.v4.hateoas.HateoasNoarkObject in project nikita-noark5-core by HiOA-ABI.
the class HateoasHandler method addSelfLink.
@Override
public void addSelfLink(INikitaEntity entity, IHateoasNoarkObject hateoasNoarkObject) {
String systemId = entity.getSystemId();
hateoasNoarkObject.addLink(entity, new Link(contextPath + HATEOAS_API_PATH + SLASH + entity.getFunctionalTypeName() + SLASH + entity.getBaseTypeName() + SLASH + systemId + SLASH, getRelSelfLink(), false));
}
use of nikita.common.model.noark5.v4.hateoas.HateoasNoarkObject in project nikita-noark5-core by HiOA-ABI.
the class HateoasHandler method addLinksOnTemplate.
@Override
public void addLinksOnTemplate(IHateoasNoarkObject hateoasNoarkObject, HttpServletRequest request, IAuthorisation authorisation) {
setParameters(request);
this.authorisation = authorisation;
Iterable<INikitaEntity> entities = hateoasNoarkObject.getList();
for (INikitaEntity entity : entities) {
addEntityLinksOnTemplate(entity, hateoasNoarkObject);
}
}
use of nikita.common.model.noark5.v4.hateoas.HateoasNoarkObject in project nikita-noark5-core by HiOA-ABI.
the class HateoasHandler method addLinks.
@Override
public void addLinks(IHateoasNoarkObject hateoasNoarkObject, HttpServletRequest request, IAuthorisation authorisation) {
setParameters(request);
this.authorisation = authorisation;
Iterable<INikitaEntity> entities = hateoasNoarkObject.getList();
for (INikitaEntity entity : entities) {
addSelfLink(entity, hateoasNoarkObject);
addEntityLinks(entity, hateoasNoarkObject);
}
// { "entity": [], "_links": [] }
if (!hateoasNoarkObject.isSingleEntity()) {
StringBuffer url = request.getRequestURL();
Link selfLink = new Link(url.toString(), getRelSelfLink(), false);
hateoasNoarkObject.addSelfLink(selfLink);
}
}
use of nikita.common.model.noark5.v4.hateoas.HateoasNoarkObject in project nikita-noark5-core by HiOA-ABI.
the class HateoasHandler method addLinksOnNew.
@Override
public void addLinksOnNew(IHateoasNoarkObject hateoasNoarkObject, IAuthorisation authorisation) {
this.authorisation = authorisation;
Iterable<INikitaEntity> entities = hateoasNoarkObject.getList();
for (INikitaEntity entity : entities) {
addEntityLinksOnNew(entity, hateoasNoarkObject);
}
}
Aggregations