Examples of Representation


Examples of com.theoryinpractise.halbuilder.api.Representation

    int pageNumber = Integer.valueOf(rawPageNumber.get());

    PaginatedList<User> users = userReadService.getPaginatedList(pageSize, pageNumber);

    // Provide a representation to the client
    Representation representation = new AdminUserCollectionRepresentation().get(users, Optional.of(adminUser));

    return ok(representation);

  }
View Full Code Here

Examples of com.volantis.map.retriever.Representation

                ImageProcessor processor =
                    ImageProcessorFactory.getInstance().
                        createImageProcessor(ToolFactory.getInstance(),
                                             ImageWriterFactory.getInstance());

                Representation representation =
                    ImageLoader.load(descriptor.getInputParameters().getParameterValue(ParameterNames.SOURCE_URL),
                            retriever, request, descriptor);
                inputStream = new NoCloseSeekableInputStream(representation.getSeekableInputStream());
                new PreservationParamsBuilder().process(request, descriptor);

                // now get the input stream for the watermark image.
                // @todo later this could probably be cached.
                if (descriptor.getInputParameters().containsName(
                    ParameterNames.WATERMARK_URL)) {
                    Representation watermarkRepresentation =
                        ImageLoader.load(descriptor.getInputParameters().getParameterValue(ParameterNames.WATERMARK_URL),
                                retriever, request, descriptor);
                    watermarkStream =
                        new NoCloseSeekableInputStream(watermarkRepresentation.getSeekableInputStream());
                    descriptor.getInputParameters().setObject(
                        ParameterNames.WATERMARK_INPUT_STREAM, watermarkStream);
                }

                outputData =
View Full Code Here

Examples of data.programmation.Representation

       * 1 = idseance = string
       * 2 = dateseance = date
       * 3 = heure = int
       * 4 = nbplacesrestantes = int
       */
      Representation repres = new Representation(
          seancesRS.getString(1),
          seancesRS.getDate(2),
          seancesRS.getInt(3)
          );
      repres.setNbPlacesRestantes(seancesRS.getInt(4));

      lesSeances.add(repres);
    }

    return lesSeances;
View Full Code Here

Examples of ds.pjftp.representation.Representation

            session.replyWithSpace(501, "Syntax error.");
            return;
        }

        final char type = param.charAt(0);
        final Representation representation = Representations.get(type);

        if (representation == null) {
            session.replyWithSpace(504, "Not implemented for this command.");
            return;
        }
View Full Code Here

Examples of it.freedomotic.model.object.Representation

    }

    public void evaluateGate() {
        //checks the intersection with the first view in the list
        //others views are ignored!!!
        Representation representation = getPojo().getRepresentations().get(0);
        FreedomPolygon pojoShape = (FreedomPolygon) representation.getShape();
        int xoffset = representation.getOffset().getX();
        int yoffset = representation.getOffset().getY();
//        double rotation = Math.toRadians(representation.getRotation());
        from = null;
        to = null;

        //now apply offset and rotation to gate the shape
//        AffineTransform transform = new AffineTransform();
//        transform.translate(xoffset, yoffset);
//        transform.rotate(rotation);
//        Shape gateShape = transform.createTransformedShape(TopologyUtils.convertToAWT(pojoShape));
//
//        for (Room room : Freedomotic.environment.getRooms()) {
//            Shape roomPolygon = TopologyUtils.convertToAWT(room.getPojo().getShape());
//            if (roomPolygon.intersects(gateShape.getBounds2D())) {
//                if (from == null) {
//                    from = (Room) room;
//                    to = (Room) room;
//                } else {
//                    to = (Room) room;
//                }
//            }
//        }
        FreedomPolygon objShape =
                TopologyUtils.rotate(TopologyUtils.translate(pojoShape, xoffset, yoffset),
                (int) representation.getRotation());
        EnvironmentLogic env = EnvironmentPersistence.getEnvByUUID(getPojo().getEnvironmentID());

        if (env != null) {
            for (Room room : env.getRooms()) {
                if (TopologyUtils.intersects(objShape,
View Full Code Here

Examples of net.java.dev.wadl.x2009.x02.RepresentationDocument.Representation

      else
      {
        response = responses.get( null );
      }

      Representation representationConfig = response.addNewRepresentation();
      generateRepresentation( representationConfig, representation );

      if( !isWADL11 && representation.getType() == RestRepresentation.Type.FAULT )
      {
        Element resp = ( Element )response.getDomNode();
        Element rep = ( Element )representationConfig.getDomNode();
        Element fault = resp.getOwnerDocument().createElementNS( Constants.WADL11_NS, "fault" );

        NamedNodeMap attributes = rep.getAttributes();
        for( int i = 0; i < attributes.getLength(); i++ )
        {
View Full Code Here

Examples of org.apache.isis.viewer.json.viewer.representations.Representation

        this.objectAdapter = objectAdapter;
    }
   
    public Representation build() {
        RepContext repContext = this.repContext.underAttribute("_self");
        Representation selfLink = LinkRepBuilder.newBuilder(repContext, "link", url()).build();
        Representation selfType = LinkRepBuilder.newTypeBuilder(repContext, "type", objectAdapter.getSpecification()).build();
        String title = objectAdapter.titleString();
        Representation iconLink = LinkRepBuilder.newBuilder(repContext, "icon", icon()).build();
        Representation self = new Representation();
        self.put("link", selfLink);
        self.put("type", selfType);
        self.put("title", title);
        self.put("icon", iconLink);
        representation.put("_self", self);
        withAllMembers(objectAdapter);
        if(!members.isEmpty()) {
            for(Map.Entry<String, Representation> entry: members.entrySet()) {
                String memberId = entry.getKey();
                Representation memberRep = entry.getValue();
                representation.put(memberId, memberRep);
            }
        }
        return representation;
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation

        Cache cache = getCache();
        Entity entity = null;
        long start = System.currentTimeMillis();
        if (cache != null) {
            try {
                Representation rep = cache.getRepresentation(id);
                if (rep != null) {
                    entity = new EntityImpl(getId(), rep, null);
                    initEntityMetadata(entity, siteMetadata,
                        singletonMap(RdfResourceEnum.isChached.getUri(), (Object) Boolean.TRUE));
                } else if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) {
                    return null; // do no remote lokkups on CacheStrategy.all!!
                }
            } catch (YardException e) {
                if (siteConfiguration.getEntityDereferencerType() == null || isOfflineMode()) {
                    throw new SiteException(String.format("Unable to get Represetnation %s form Cache %s",
                        id, siteConfiguration.getCacheId()), e);
                } else {
                    log.warn(
                        String.format(
                            "Unable to get Represetnation %s form Cache %s. Will dereference from remote site %s",
                            id, siteConfiguration.getCacheId(), siteConfiguration.getAccessUri()), e);
                }
            }
        } else {
            if (siteConfiguration.getEntityDereferencerType() == null || isOfflineMode()) {
                throw new SiteException(String.format(
                    "Unable to get Represetnation %s because configured Cache %s is currently not available",
                    id, siteConfiguration.getCacheId()));
            } else {
                log.warn(String.format(
                    "Cache %s is currently not available. Will use remote site %s to load Representation %s",
                    siteConfiguration.getCacheId(), siteConfiguration.getEntityDereferencerType(), id));
            }
        }
        if (entity == null) { // no cache or not found in cache
            if (dereferencer == null) {
                throw new SiteException(String.format(
                    "Entity Dereferencer %s for accessing remote site %s is not available",
                    siteConfiguration.getEntityDereferencerType(), siteConfiguration.getAccessUri()));
            }
            ensureOnline(siteConfiguration.getAccessUri(), dereferencer.getClass());
            Representation rep = null;
            try {
                rep = dereferencer.dereference(id);
            } catch (IOException e) {
                throw new SiteException(String.format(
                    "Unable to load Representation for entity %s form remote site %s with dereferencer %s",
View Full Code Here

Examples of org.assertj.core.presentation.Representation

  }

  @Test
  public void should_implement_toString() {
    Description description = new TestDescription("Test");
    Representation representation = new StandardRepresentation();
    String formattedMessage = "[Test] Hello Yoda";
    when(formatter.format(description, representation, "Hello %s", "Yoda")).thenReturn(formattedMessage);
    assertEquals(formattedMessage, factory.create(description, representation));
  }
View Full Code Here

Examples of org.assertj.core.presentation.Representation

  }

  @Test
  public void should_format_message() {
    Description description = new TextDescription("Test");
    Representation representation = new StandardRepresentation();
    String s = messageFormatter.format(description, representation, "Hello %s", "World");
    assertEquals("[Test] Hello \"World\"", s);
    verify(descriptionFormatter).format(description);
  }
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.