public class PersonDetailsViewRenderer extends AbstractViewRenderer { public void render( Field field, DocumentFragment fragment, RendererContext context, RendererContract contract) throws ClientException, DataAccessException, PlugInException { String name = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/name")); String reference = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/reference")); String address = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/address")); String gender = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/gender")); String dateOfBirth = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/dob")); String age = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/age")); String phone = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/phone")); String email = context.getDataAccessor().get( field.getBinding().getSourcePath() .extendPath("/details/e-mail")); Document doc = fragment.getOwnerDocument(); Element detailsPanelDiv = doc.createElement("div"); detailsPanelDiv.setAttribute("class", "person-details-container"); fragment.appendChild(detailsPanelDiv); Element div; Element image; div = doc.createElement("div"); div.setAttribute("class", "header-info"); div.appendChild(doc.createTextNode(name)); div.appendChild(doc.createTextNode(" - ")); div.appendChild(doc.createTextNode(reference)); detailsPanelDiv.appendChild(div); div = doc.createElement("div"); div.appendChild(doc.createTextNode(address)); detailsPanelDiv.appendChild(div); div = doc.createElement("div"); div.appendChild(doc.createTextNode(gender)); detailsPanelDiv.appendChild(div); div = doc.createElement("div"); div.appendChild(doc.createTextNode("Born ")); div.appendChild(doc.createTextNode(dateOfBirth)); div.appendChild(doc.createTextNode(", Age ")); div.appendChild(doc.createTextNode(age)); detailsPanelDiv.appendChild(div); div = doc.createElement("div"); div.setAttribute("class", "contact-info"); detailsPanelDiv.appendChild(div); image = doc.createElement("img"); image.setAttribute("src", "../Images/phone_icon.png"); div.appendChild(image); div.appendChild(doc.createTextNode(phone)); FieldBuilder fb = ComponentBuilderFactory.createFieldBuilder(); fb.setDomain( context.getDomain("SAMPLE_EMAIL")); fb.setSourcePath( field.getBinding().getSourcePath() .extendPath("/details/e-mail")); DocumentFragment emailFragment = doc.createDocumentFragment(); context.render(fb.getComponent(), emailFragment, contract.createSubcontract()); div.appendChild(emailFragment); } }