Examples of withLink()


Examples of com.theoryinpractise.halbuilder.api.Representation.withLink()

        .queryParam("pn", pagination.getCurrentPage())
        .queryParam("ps",pagination.getResultsPerPage())
        .build();

      representation = factory.newRepresentation(paginatedSelf);
      representation
        .withLink("first", UriBuilder
          .fromUri(self)
          .queryParam("pn", 1)
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
View Full Code Here

Examples of com.theoryinpractise.halbuilder.api.Representation.withLink()

      representation = factory.newRepresentation(self);
    }

    // Add any links
    for (Map.Entry<String, String> entry : links.entrySet()) {
      representation.withLink(entry.getKey(), entry.getValue());
    }

    // Add the bean
    if (beanOptional.isPresent()) {
      representation.withBean(beanOptional.get());
View Full Code Here

Examples of com.theoryinpractise.halbuilder.api.Representation.withLink()

      LocalisedText primaryDetail = itemFieldDetail.getPrimaryDetail();

      // TODO Consider how i18n will be transmitted
      // Consider filtering on Locale
      if (isLink) {
        userRepresentation.withLink(propertyName,primaryDetail.getContent());
      } else {
        userRepresentation.withProperty(propertyName, primaryDetail.getContent());
      }
      Set<LocalisedText> secondaryDetails = itemFieldDetail.getSecondaryDetails();
      // TODO Consider if a 1-based field index is the best representation here: array? sub-resource?
View Full Code Here

Examples of com.theoryinpractise.halbuilder.api.Representation.withLink()

      Set<LocalisedText> secondaryDetails = itemFieldDetail.getSecondaryDetails();
      // TODO Consider if a 1-based field index is the best representation here: array? sub-resource?
      int index = 1;
      for (LocalisedText secondaryDetail : secondaryDetails) {
        if (isLink) {
          userRepresentation.withLink(propertyName + index,secondaryDetail.getContent());
        } else {
          userRepresentation.withProperty(propertyName + index, secondaryDetail.getContent());
        }
        index++;
      }
View Full Code Here

Examples of com.theoryinpractise.halbuilder.impl.representations.MutableRepresentation.withLink()

            representation.withNamespace(entry.getKey(), entry.getValue());
        }

        // Add factory standard links
        for (Link link : links) {
            representation.withLink(link.getRel(), link.getHref(), link.getName(), link.getTitle(), link.getHreflang(), link.getProfile());
        }

        return representation;
    }
View Full Code Here

Examples of com.theoryinpractise.halbuilder.impl.representations.MutableRepresentation.withLink()

            representation.withNamespace(entry.getKey(), entry.getValue());
        }

        // Add factory standard links
        for (Link link : links) {
            representation.withLink(link.getRel(), link.getHref(), link.getName(), link.getTitle(), link.getHreflang(), link.getProfile());
        }

        return representation;
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.rendering.domaintypes.TypeListReprRenderer.withLink()

        final JsonRepresentation link = LinkBuilder.newBuilder(getRendererContext(), Rel.DOMAIN_TYPES.getName(), RepresentationType.TYPE_LIST, "domain-types").build();

        final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow("links");
        if (linkFollower.matches(link)) {
            final TypeListReprRenderer renderer = new TypeListReprRenderer(getRendererContext(), linkFollower, JsonRepresentation.newMap());
            renderer.withLink(Rel.SELF, "domain-types").with(specifications);
            link.mapPut("value", renderer.render());
        }

        getLinks().arrayAdd(link);
    }
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.