Examples of UriRef


Examples of org.apache.clerezza.rdf.core.UriRef

    return getTypeHandler(absoluteUriPath);
  }

  private Object getTypeHandler(String absoluteUriPath) throws ResourceMethodException {
    LockableMGraph contentMGraph = tcManager.getMGraph(Constants.CONTENT_GRAPH_URI);
    UriRef uri = new UriRef(absoluteUriPath);

    Set<UriRef> rdfTypes = getRdfTypesOfUriRef(contentMGraph, uri);

    return typeHandlerDiscovery.getTypeHandler(rdfTypes);
   
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

        if (!(typeStmtObj instanceof UriRef)) {
          throw new RuntimeException(
              "RDF type is expected to be a URI but is " + typeStmtObj
              + "(in " + triple + ")");
        }
        UriRef rdfType = (UriRef) typeStmtObj;
        rdfTypes.add(rdfType);
      }
    } finally {
      readLock.unlock();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

    @GET
    public Object getDescription(@Context UriInfo uriInfo){
      String absoluteUriPath = uriInfo.getAbsolutePath().toString();
      MGraph contentMGraph = tcManager.getMGraph(Constants.CONTENT_GRAPH_URI);
        UriRef uri = new UriRef(absoluteUriPath.substring(0,
            absoluteUriPath.length() - DESCRIPTION_SUFFIX.length()));
        GraphNode graphNode = new GraphNode(uri, contentMGraph);
        return graphNode.getNodeContext();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

  public void containsTest() throws IOException {
    WebRenderingFunctions webRenderingFunctions = new WebRenderingFunctions(
        null, null, null, null);
    RenderingFunction<Object, Boolean> function = webRenderingFunctions
        .getNamedFunctions().get("contains");
    UriRef testObject = new UriRef("http://example.org/bla#fooBar");
    Assert.assertTrue(function.process(testObject, "bla"));
    Assert.assertFalse(function.process(testObject, "hello"));
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

      Iterator<UriRef> remainingIter = null;
      UriRef next = prepareNext();
     
      private UriRef prepareNext() {
        while (typePriorityIter.hasNext()) {
          UriRef nextPriority = typePriorityIter.next();
          if (remaining.contains(nextPriority)) {
            remaining.remove(nextPriority);
            return nextPriority;
          }
        }
        if (remainingIter == null) {
          remainingIter = remaining.iterator();
        }
        if (remainingIter.hasNext()) {
          return remainingIter.next();
        } else {
          if (rdfsResourceRemovedAndNotYetReturned) {
            rdfsResourceRemovedAndNotYetReturned = false;
            return RDFS.Resource;
          } else {
            return null;
          }
        }
      }

      @Override
      public boolean hasNext() {
        return next != null;
      }

      @Override
      public UriRef next() {
        if (next == null) {
          throw new NoSuchElementException();
        }
        UriRef current = next;
        next = prepareNext();
        return current;
      }

      @Override
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

      userProps.add(userPropsIter.next());
    }
    userProps.remove(HIERARCHY.members);
    if (requestedProps != null) {
      for (Property requestedProp : requestedProps) {
        UriRef predicate = new UriRef(requestedProp.value());
        if (userProps.contains(predicate)) {
          readLock.lock();
          try {
            Iterator<Resource> value = node.getObjects(predicate);
            if (value.hasNext()) {
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

  static Document modifyProperties(GraphNode hierarchyNode, NodeList propsToSet,
      NodeList propsToRemove) throws ParserConfigurationException {
    Document responseDoc = DocumentBuilderFactory.newInstance()
          .newDocumentBuilder().newDocument();
    UriRef subject = (UriRef) hierarchyNode.getNode();
    Element hrefElement = responseDoc.createElementNS(davUri, href);
    hrefElement.setTextContent(subject.getUnicodeString());
    Element multistatus = responseDoc.createElementNS(davUri, multistat);
    Element responseElement = responseDoc.createElementNS(davUri, response);
    Element propOk = responseDoc.createElementNS(davUri, prop);
    Element propForbidden = responseDoc.createElementNS(davUri, prop);

    responseDoc.appendChild(multistatus);
    multistatus.appendChild(responseElement);
    responseElement.appendChild(hrefElement);

    Map<Property, String> setMap = getNodeListAsMap(propsToSet);
    Map<Property, String> removeMap = getNodeListAsMap(propsToRemove);
    TripleCollection contentGraph = hierarchyNode.getGraph();
    for(Map.Entry<Property, String> entry : setMap.entrySet()){
      Property property = entry.getKey();
      if(property.ns.equalsIgnoreCase(davUri)){
        if(protectedProps.contains(property.prop)){
          propForbidden.appendChild(responseDoc
              .createElementNS(davUri, property.prop));
        } else {
          UriRef predicate = new UriRef(property.value());
          Lock writeLock = hierarchyNode.writeLock();
          writeLock.lock();
          try {
            Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
            replaceProp(subject, predicate, valIter, contentGraph, entry);
          } finally {
            writeLock.unlock();
          }
          propOk.appendChild(responseDoc.createElementNS(davUri, property.prop));
        }
      } else {
        UriRef predicate = new UriRef(property.value());
        Lock writeLock = hierarchyNode.writeLock();
        writeLock.lock();
        try {
          Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
          replaceProp(subject, predicate, valIter, contentGraph, entry);
        } finally {
          writeLock.unlock();
        }
        propOk.appendChild(responseDoc.createElementNS(property.ns, "R:" + property.prop));
      }
    }

    for(Map.Entry<Property, String> entry : removeMap.entrySet()){
      Property property = entry.getKey();
      if(davProps.contains(property.prop)){
        propForbidden.appendChild(responseDoc
              .createElementNS(davUri, property.prop));
      } else {
        UriRef predicate = new UriRef(property.value());
        Lock writeLock = hierarchyNode.writeLock();
        writeLock.lock();
        try {
          Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
          Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

        resourceDir.getFile());

    fileServer = new FileServer(pathNode);

    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
        "user-overview-template.ssp").toURI().toString()),
        USERMANAGER.UserOverviewPage, "naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource("add-user-template.ssp")
            .toURI().toString()),
        USERMANAGER.AddUserPage, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
            "user-permission-template.ssp").toURI().toString()),
        USERMANAGER.UserPermissionPage, "naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
        "update-user-template.ssp").toURI().toString()),
        USERMANAGER.UpdateUserPage, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
            "custom-property-template.ssp").toURI().toString()),
        USERMANAGER.CustomFieldPage, "naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
        "role-overview-template.ssp").toURI().toString()),
        USERMANAGER.RoleOverviewPage, "naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
        "role-permission-template.ssp").toURI().toString()),
        USERMANAGER.RolePermissionPage, "naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(getClass().getResource(
            "add-property-template.ssp").toURI().toString()),
        USERMANAGER.AddCustomPropertyPage,"naked",
        MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderletManager
        .registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
            new UriRef(getClass().getResource(
                "custom-user-infos-template.ssp").toURI().toString()),
            USERMANAGER.CustomUserInformationPage, "naked",
            MediaType.APPLICATION_XHTML_XML_TYPE, true);
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

   
    GraphNode result = new GraphNode(userOverviewPage, unionGraph);

    result.addProperty(RDF.type, USERMANAGER.UserOverviewPage);
    result.addProperty(RDF.type, PLATFORM.HeadedPage);
    result.addProperty(LIST.predecessor, new UriRef(uriInfo
        .getAbsolutePath().toString()
        + "?from=" + prevFrom + "&to=" + from));
    result.addProperty(LIST.successor, new UriRef(uriInfo.getAbsolutePath()
        .toString()
        + "?from=" + to + "&to=" + nextTo));
    result.addProperty(LIST.indexFrom, LiteralFactory.getInstance()
        .createTypedLiteral(from));
    result.addProperty(LIST.indexTo, LiteralFactory.getInstance()
View Full Code Here

Examples of org.apache.clerezza.rdf.core.UriRef

            .getCustomfieldsOfCollection(collection));
      }
    }

    for (NonLiteral customField : customfields) {
      UriRef property = customPropertyManager
  .getCustomFieldProperty(customField);

      if (userName != null && !userName.equals("")
          && userName.trim().length() > 0) {
        NonLiteral user = getCustomUser(contentGraph, userName);
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.