private void addValueLink(DelegatingResourceDescription rep, FormResource delegate) { rep.addLink("value", "./value"); } }
public DelegatingResourceDescription addSelfLink() { return addLink("self", "."); }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("handlerClassname"); description.addProperty("display", "textToDisplay"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; }
@RepHandler(DefaultRepresentation.class) public SimpleObject asDefaultRep(FormResource delegate) throws Exception { DelegatingResourceDescription rep = new DelegatingResourceDescription(); rep.addProperty("uuid"); rep.addProperty("name"); rep.addProperty("valueReference"); rep.addProperty("display"); addValueLink(rep, delegate); rep.addSelfLink(); rep.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return convertDelegateToRepresentation(delegate, rep); }
@RepHandler(DefaultRepresentation.class) public SimpleObject asDefaultRep(T delegate) throws Exception { DelegatingResourceDescription rep = new DelegatingResourceDescription(); rep.addProperty("uuid"); rep.addProperty("display"); rep.addProperty("name"); rep.addProperty("description"); rep.addProperty("retired"); rep.addSelfLink(); rep.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return convertDelegateToRepresentation(delegate, rep); }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("value"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingConverter#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("name"); description.addProperty("description"); description.addProperty("retired"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else { description.addProperty("auditInfo"); } return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("name"); description.addProperty("description"); description.addProperty("retired"); description.addProperty("careSettingType"); description.addProperty("display"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else { description.addProperty("auditInfo"); } return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof RefRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addSelfLink(); return description; } else if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("patient"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("patient"); //description.addProperty("auditInfo", findMethod("getAuditInfo")); description.addSelfLink(); return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getRepresentationDescription(Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("description"); description.addProperty("aIsToB"); description.addProperty("bIsToA"); description.addProperty("displayAIsToB"); description.addProperty("displayBIsToA"); description.addProperty("retired"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { description.addProperty("weight"); description.addProperty("auditInfo"); return description; } return null; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("provider", Representation.REF); description.addProperty("encounterRole", Representation.REF); description.addProperty("voided"); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("provider", Representation.DEFAULT); description.addProperty("encounterRole", Representation.DEFAULT); description.addProperty("voided"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("conceptReferenceTerm", Representation.REF); description.addProperty("conceptMapType", Representation.REF); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("conceptReferenceTerm", Representation.DEFAULT); description.addProperty("conceptMapType", Representation.DEFAULT); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("messageState"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("source", Representation.DEFAULT); description.addProperty("sourceKey"); description.addProperty("data"); description.addProperty("messageState"); description.addSelfLink(); return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("concept", Representation.REF); description.addProperty("field", Representation.REF); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("concept"); description.addProperty("field"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
/** * @see DelegatingCrudResource#getRepresentationDescription(Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("name"); description.addProperty("javaClassName"); description.addProperty("retired"); description.addProperty("description"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addProperty("conceptClasses", Representation.REF); description.addProperty("parent", Representation.REF); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else { description.addProperty("conceptClasses"); description.addProperty("parent"); description.addProperty("auditInfo"); } return description; } return null; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("source", Representation.REF); description.addProperty("sourceCode"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("source", Representation.DEFAULT); description.addProperty("sourceCode"); description.addProperty("comment"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("ingredient", Representation.REF); description.addProperty("strength"); description.addProperty("units", Representation.REF); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("ingredient", Representation.REF); description.addProperty("strength"); description.addProperty("units", Representation.REF); description.addSelfLink(); return description; } return null; }
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description;
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("name"); description.addProperty("locale"); description.addProperty("localePreferred"); description.addProperty("conceptNameType"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("name"); description.addProperty("locale"); description.addProperty("localePreferred"); description.addProperty("conceptNameType"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("description"); description.addProperty("retired"); description.addProperty("concept", Representation.DEFAULT); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("description"); description.addProperty("retired"); description.addProperty("concept", Representation.FULL); description.addSelfLink(); return description; } else if (rep instanceof RefRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("retired"); description.addProperty("concept", Representation.REF); description.addSelfLink(); return description; } return null; }