Examples of ResourceDescription


Examples of de.fuberlin.wiwiss.pubby.ResourceDescription

      HttpServletRequest request,
      HttpServletResponse response,
      Configuration config) throws IOException {
    HypermediaControls controller = config.getControls(relativeURI, false);

    ResourceDescription description = controller == null ?
        null : controller.getResourceDescription();
    // Check if resource exists in dataset
    if (description == null) {
      response.setStatus(404);
      response.setContentType("text/plain");
      response.getOutputStream().println("Nothing known about <" + controller.getAbsoluteIRI() + ">");
      return true;
    }
    Model model = description.getModel();
   
    addHighDegreePropertyLinks(model, controller);
   
    addDocumentMetadata(model, controller,
        addQueryString(controller.getDataURL(), request),
        "RDF description of " + description.getTitle());
   
    ModelResponse server = new ModelResponse(model, request, response);
    server.serve();
    return true;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.pubby.ResourceDescription

  public boolean doGet(HypermediaControls controller,
      Property predicate, boolean isInverse,
      HttpServletRequest request,
      HttpServletResponse response,
      Configuration config) throws IOException {   
    ResourceDescription resource = controller.getResourceDescription();
    if (resource == null) return false;

    Model descriptions = config.getDataSource().listPropertyValues(
        controller.getAbsoluteIRI(), predicate, isInverse);
    if (descriptions.isEmpty()) return false;
    ResourceProperty property = new ResourceDescription(
        controller, descriptions, config).getProperty(predicate, isInverse);
    if (property == null) return false// Can happen if prefix is declared in URI space of a data source rather than in web space
   
    VelocityHelper template = new VelocityHelper(getServletContext(), response);
    Context context = template.getVelocityContext();
    context.put("project_name", config.getProjectName());
    context.put("project_link", config.getProjectLink());
    context.put("uri", resource.getURI());
    context.put("server_base", config.getWebApplicationBaseURI());
    context.put("title", resource.getTitle());
    context.put("head_title", resource.getTitle() + " \u00BB " + property.getCompleteLabel());
    context.put("property", property);
    context.put("back_uri", controller.getBrowsableURL());
    context.put("back_label", resource.getTitle());
    context.put("rdf_link", isInverse ? controller.getInverseValuesDataURL(predicate) : controller.getValuesDataURL(predicate));
    context.put("showLabels", config.showLabels());

    addPageMetadata(context, controller, resource.getModel());
   
    template.renderXHTML("valuespage.vm");
    return true;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.pubby.ResourceDescription

      HttpServletResponse response,
      Configuration config) throws ServletException, IOException {

    HypermediaControls controller = config.getControls(relativeURI, false);
    if (controller == null) return false;
    ResourceDescription description = controller.getResourceDescription();
    if (description == null) return false;
   
    VelocityHelper template = new VelocityHelper(getServletContext(), response);
    Context context = template.getVelocityContext();
    context.put("project_name", config.getProjectName());
    context.put("project_link", config.getProjectLink());
    context.put("uri", description.getURI());
    context.put("server_base", config.getWebApplicationBaseURI());
    context.put("rdf_link", controller.getDataURL());
    context.put("title", description.getTitle());
    context.put("comment", description.getComment());
    context.put("image", description.getImageURL());
    context.put("properties", description.getProperties());
    context.put("showLabels", config.showLabels());

    addPageMetadata(context, controller, description.getModel());
 
    template.renderXHTML("page.vm");
    return true;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.pubby.ResourceDescription

      HttpServletResponse response,
      Configuration config) throws IOException {
    // TODO: If no data ("return false"), respond with plain text like the PageURLServlet, not with HTML
   
    // TODO: Good bit of duplication with ValuesURLServlet here
    ResourceDescription resource = controller.getResourceDescription();
    if (resource == null) return false;

    Model descriptions = config.getDataSource().listPropertyValues(
        controller.getAbsoluteIRI(), predicate, isInverse);
    if (descriptions.isEmpty()) return false;
    ResourceProperty property = new ResourceDescription(
        controller, descriptions, config).getProperty(predicate, isInverse);
    if (property == null) return false// Can happen if prefix is declared in URI space of a data source rather than in web space

    addDocumentMetadata(descriptions, controller,
        addQueryString(
            isInverse
                ? controller.getInverseValuesDataURL(predicate)
                : controller.getValuesDataURL(predicate),
            request),
        getDocumentTitle(
            resource.getTitle(), property.getCompleteLabel(), isInverse));
   
    new ModelResponse(descriptions, request, response).serve();
    return true;
  }
View Full Code Here

Examples of eu.scape_project.planning.model.ResourceDescription

     * @return the alternative
     */
    private Alternative generateAlternative(String name) {
        Alternative a = new Alternative(name, "Description");
        a.setDiscarded(false);
        ResourceDescription resourceDescription = new ResourceDescription();
        a.setResourceDescription(resourceDescription);
        Experiment experiment = new Experiment();
        experiment.setDescription("Description");
        experiment.setSettings("Settings");
        experiment.setWorkflow(generateDigitalObject());
View Full Code Here

Examples of org.eclipse.orion.server.core.resources.annotations.ResourceDescription

   * @param resourceClass resource class
   * @param selectionQuery selection query
   * @return {@link this}
   */
  public static ResourceShape createResourceShape(final Class<?> resourceClass, String selectionQuery) {
    final ResourceDescription resourceShapeDescription = resourceClass.getAnnotation(ResourceDescription.class);
    Assert.isNotNull(resourceShapeDescription);
    if (selectionQuery == null) {
      return getDefaultResourceShape(resourceClass);
    } else {
      String resourceShapeFieldName = parseSelectionQuery(selectionQuery);
View Full Code Here

Examples of org.eclipse.orion.server.core.resources.annotations.ResourceDescription

          result.put(property.getName(), serialize(value, nestedResourceShape));
        } else {
          result.put(property.getName(), value);
        }
      }
      final ResourceDescription resourceShapeDescription = resource.getClass().getAnnotation(ResourceDescription.class);
      // TODO: org.eclipse.orion.internal.server.servlets.ProtocolConstants.KEY_TYPE
      result.put("Type", resourceShapeDescription.type()); //$NON-NLS-1$
    } catch (JSONException e) {
      // should never happen
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.ui.ide.undo.ResourceDescription

      saveCUnitIfNeeded(unit, new SubProgressMonitor(pm, 1));
      // element.delete(false, new SubProgressMonitor(pm, 1));

      IResource resource = unit.getResource();
      if (resource != null) {
        ResourceDescription resourceDescription = ResourceDescription
            .fromResource(resource);
        element.delete(false, new SubProgressMonitor(pm, 1));
        resourceDescription.recordStateFromHistory(resource,
            new SubProgressMonitor(pm, 1));
        return new UndoDeleteResourceChange(resourceDescription);
      } else {
        element.delete(false, pm);
      }
View Full Code Here

Examples of org.eclipse.ui.ide.undo.ResourceDescription

    DynamicValidationStateChange result = (DynamicValidationStateChange) super
        .perform(new SubProgressMonitor(pm, count));

    for (int i = 0; i < fPackageDeletes.size(); i++) {
      IResource resource = (IResource) fPackageDeletes.get(i);
      ResourceDescription resourceDescription = packageDeleteDescriptions[i];
      resourceDescription.recordStateFromHistory(resource,
          new SubProgressMonitor(pm, 1));
      result.add(new UndoDeleteResourceChange(resourceDescription));
    }
    return result;
  }
View Full Code Here

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

    for (Entry<String, Class<?>> projection : projections.entrySet()) {

      Class<?> type = projection.getValue();
      String key = String.format("%s.%s.%s", metadata.getRel(), projectionParameterName, projection.getKey());
      ResourceDescription fallback = SimpleResourceDescription.defaultFor(key);
      AnnotationBasedResourceDescription projectionDescription = new AnnotationBasedResourceDescription(type, fallback);

      projectionDescriptors.add(//
          descriptor().//
              type(Type.SEMANTIC).//
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.