Examples of DescriptorBuilder


Examples of org.exoplatform.web.controller.metadata.DescriptorBuilder

    private void loadConfiguration(URL url) throws RouterConfigException, IOException {
        log.info("Loading router configuration " + url);
        InputStream in = url.openStream();
        try {
            ControllerDescriptor routerDesc = new DescriptorBuilder().build(in);
            Router router = new Router(routerDesc);
            routerRef.set(router);
        } finally {
            Safe.close(in);
        }
View Full Code Here

Examples of org.springframework.hateoas.alps.Descriptor.DescriptorBuilder

      public void doWithAssociation(Association<? extends PersistentProperty<?>> association) {

        PersistentProperty<?> property = association.getInverse();
        ResourceMapping mapping = propertyMappings.getMappingFor(property);

        DescriptorBuilder builder = descriptor().//
            name(mapping.getRel()).doc(getDocFor(mapping.getDescription()));

        if (associationLinks.isLinkableAssociation(property)) {

          ResourceMetadata targetTypeMapping = mappings.getMappingFor(property.getActualType());
          String localPath = targetTypeMapping.getRel().concat("#").concat(targetTypeMapping.getItemResourceRel());
          Link link = ControllerLinkBuilder.linkTo(AlpsController.class).slash(localPath).withSelfRel();

          builder.//
              type(Type.SAFE).//
              rt(link.getHref());

        } else {

          List<Descriptor> nestedDescriptors = buildPropertyDescriptors(property.getActualType(), baseRel.concat(".")
              .concat(mapping.getRel()));

          builder = builder.//
              type(Type.SEMANTIC).//
              descriptors(nestedDescriptors);
        }

        propertyDescriptors.add(builder.build());
      }
    });

    return propertyDescriptors;
  }
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.