Examples of HypermediaResource


Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

      context.convertAnother(((ConfigurableHypermediaResource) root).getModel());
    } else {
      base.marshal(root, writer, context);
    }

    HypermediaResource resource = (HypermediaResource) root;
    RelationBuilder builder = restfulie.newRelationBuilder();
    resource.configureRelations(builder);
    for (Relation t : builder.getRelations()) {
      writer.startNode("atom:link");
      writer.addAttribute("rel", t.getName());
      writer.addAttribute("href", config.getApplicationPath() + t.getUri());
      writer.addAttribute("xmlns:atom", "http://www.w3.org/2005/Atom");
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

      context.convertAnother(((ConfigurableHypermediaResource) root).getModel());
    } else {
      base.marshal(root, writer, context);
    }

    HypermediaResource resource = (HypermediaResource) root;
    RelationBuilder builder = restfulie.newRelationBuilder();
    resource.configureRelations(builder);

    if( !builder.getRelations().isEmpty() ) {
      ExtendedHierarchicalStreamWriterHelper.startNode(writer, "links", List.class);
      Link link = null;
      for (Relation t : builder.getRelations()) {
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

  @Test
  public void whenTheResourceIsHypermediaAddRestHeaders() throws Exception {
    when(formatResolver.getAcceptFormat()).thenReturn("xml");

    when(serialization.accepts("xml")).thenReturn(true);
    HypermediaResource object = mock(HypermediaResource.class);
    representation.from(object);

    verify(serialization).from(object);
    verify(headerHandler).handle(object);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

  }

  public void marshal(Object root, HierarchicalStreamWriter writer,
      MarshallingContext context) {
    base.marshal(root, writer, context);
    HypermediaResource resource = (HypermediaResource) root;
    try {
      for (Relation t : resource.getRelations(restfulie)) {
        writer.startNode("atom:link");
        writer.addAttribute("rel", t.getName());
        writer.addAttribute("href", config.getApplicationPath() + t.getUri());
        writer.addAttribute("xmlns:atom", "http://www.w3.org/2005/Atom");
        writer.endNode();
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

  }

  public void marshal(Object root, HierarchicalStreamWriter writer,
      MarshallingContext context) {
    base.marshal(root, writer, context);
    HypermediaResource resource = (HypermediaResource) root;
    try {
      for (Relation t : resource.getRelations(restfulie)) {
        writer.startNode("atom:link");
        writer.addAttribute("rel", t.getName());
        writer.addAttribute("href", config.getApplicationPath() + t.getUri());
        writer.addAttribute("xmlns:atom", "http://www.w3.org/2005/Atom");
        writer.endNode();
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

      context.convertAnother(((ConfigurableHypermediaResource) root).getModel());
    } else {
      base.marshal(root, writer, context);
    }

    HypermediaResource resource = (HypermediaResource) root;
    RelationBuilder builder = restfulie.newRelationBuilder();
    resource.configureRelations(builder);

    if( !builder.getRelations().isEmpty() ) {
      ExtendedHierarchicalStreamWriterHelper.startNode(writer, "links", List.class);
      Link link = null;
      for (Relation t : builder.getRelations()) {
View Full Code Here

Examples of br.com.caelum.vraptor.restfulie.hypermedia.HypermediaResource

      context.convertAnother(((ConfigurableHypermediaResource) root).getModel());
    } else {
      base.marshal(root, writer, context);
    }

    HypermediaResource resource = (HypermediaResource) root;
    RelationBuilder builder = restfulie.newRelationBuilder();
    resource.configureRelations(builder);
    for (Relation t : builder.getRelations()) {
      writer.startNode("atom:link");
      writer.addAttribute("rel", t.getName());
      writer.addAttribute("href", config.getApplicationPath() + t.getUri());
      writer.addAttribute("xmlns:atom", "http://www.w3.org/2005/Atom");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.