Examples of ResourceDescription


Examples of org.springframework.data.rest.core.mapping.ResourceDescription

    for (BeanPropertyDefinition definition : new JacksonMetadata(mapper, type)) {

      AnnotatedMethod getter = definition.getGetter();
      Description description = getter.getAnnotation(Description.class);
      ResourceDescription fallback = SimpleResourceDescription.defaultFor(String.format("%s.%s", name,
          definition.getName()));
      ResourceDescription resourceDescription = description == null ? null : new AnnotationBasedResourceDescription(
          description, fallback);

      descriptors.add(//
          descriptor().//
              name(definition.getName()).//
View Full Code Here

Examples of org.springframework.data.rest.core.mapping.ResourceDescription

      // Skip projection parameter
      if (projectionConfiguration.getParameterName().equals(variable.getName())) {
        continue;
      }

      ResourceDescription description = SimpleResourceDescription.defaultFor(variable.getDescription());

      descriptors.add(//
          descriptor().//
              name(variable.getName()).//
              type(Type.SEMANTIC).//
View Full Code Here

Examples of org.springframework.data.rest.core.mapping.ResourceDescription

        Class<?> propertyType = persistentProperty.getType();
        String type = uncapitalize(propertyType.getSimpleName());

        ResourceMapping propertyMapping = metadata.getMappingFor(persistentProperty);
        ResourceDescription description = propertyMapping.getDescription();
        String message = resolveMessage(description);

        Property property = persistentProperty.isCollectionLike() ? //
        new ArrayProperty("array", message, false)
            : new Property(type, message, false);
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

       if ( ! ( r instanceof FramedResource) )
     error(request, "can't add frame to non-framed resource");
       // Handle the request:
       try {
    InputStream in  = getInputStream(request);
    ResourceDescription rd =
        AdminReader.readResourceDescription(in);
    String cls = rd.getClassName();
    String id  = rd.getIdentifier();
    // Create the frame:
    ResourceFrame frame = null;
     try {
         frame = (ResourceFrame) Class.forName(cls).newInstance();
     } catch (Exception ex) {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

     error(request, "Can't unregister frames from a non-framed" +
           " resource");
       }
       try {
    InputStream in = getInputStream(request);
    ResourceDescription rd =
        AdminReader.readResourceDescription(in);
    String identifier  = rd.getIdentifier();   
     // find the indentifier
     ResourceFrame f[] = ((FramedResource) r).getFrames();
     for (int i = 0 ; i < f.length ; i++)
         if (f[i].getIdentifier().equals(identifier)) {
       ((FramedResource) r).unregisterFrame(f[i]);
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

       if ( ! ( r instanceof ContainerInterface) )
     error(request, "can't add child in non-container");
       // Handle request:
       try {
    InputStream in = getInputStream(request);
    ResourceDescription rd =
        AdminReader.readResourceDescription(in);
    String cls = rd.getClassName();
    String id  = rd.getIdentifier();
     // Create the resource:
     Resource child = null;
     try {
         child = (Resource) Class.forName(cls).newInstance();
     } catch (Exception ex) {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

    change = true;
    newId = (String) values[i];
      }
  }

  ResourceDescription descr = description.getClone(attrs);

  try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

     * @exception RemoteAccessException If somenetwork failure occured.
     */
    public RemoteResource registerResource(String id, String classname)
  throws RemoteAccessException
    {
  ResourceDescription   rd   = new EmptyDescription(classname, id);
  try {
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("REGISTER-RESOURCE");
      req.setContentType(admin.conftype);
      req.setURL(url);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(rd, out);
      byte bits[] = bout.toByteArray();
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));
      // Run it:
      Reply rep = admin.runRequest(req);

      // Decode the result:
      rd = admin.reader.readResourceDescription(getInputStream(rep));
      RemoteResource ret =
    new PlainRemoteResource(admin, url, rd.getIdentifier(), rd);
     
      return ret;
  } catch (RemoteAccessException rae) {
      throw rae;
  } catch (Exception ex) {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

      // Prepare the request:
      req.setMethod("UNREGISTER-FRAME");
      req.setContentType(admin.conftype);
      req.setURL(url);

      ResourceDescription dframe = new EmptyDescription("", id);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

      Request req = createRequest();
      // Prepare the request:
      req.setMethod("REGISTER-FRAME");
      req.setContentType(admin.conftype);

      ResourceDescription dframe = new EmptyDescription(classname, id);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(dframe, out);
      byte bits[] = bout.toByteArray();
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));

      // Run it:
      Reply rep = admin.runRequest(req);
      dframe =
    admin.reader.readResourceDescription(getInputStream(rep));
      id = dframe.getIdentifier();
      URL url = null;
      if (isFrame()) {
    url = new URL(this.url, this.url.getFile()+"?" + id);
      } else {
    url = new URL(parent.toString() +
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.