Package org.apache.clerezza.rdf.core

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


    AccessController.checkPermission(new UserManagerAccessPermission());
    AccessController.checkPermission(new PermissionManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral userPermissionPage = new BNode();
    Iterator<PermissionDescripton> permDescs = permGatherer.getAllPermissionDescriptors();
    while(permDescs.hasNext()) {
      PermissionDescripton desc = permDescs.next();
      BNode providedPermission = new BNode();
      resultGraph.add(new TripleImpl(userPermissionPage,
          USERMANAGER.permission, providedPermission));

      resultGraph.add(new TripleImpl(providedPermission,
          PERMISSION.javaPermissionEntry, new PlainLiteralImpl(desc.getJavaPermissionString())));

      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.title, new PlainLiteralImpl(desc.getSimpleName())));

      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.description, new PlainLiteralImpl(desc.getDescription())));
   
    resultGraph.add(new TripleImpl(userPermissionPage, RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(userPermissionPage, RDF.type,
        USERMANAGER.UserPermissionPage));

    NonLiteral user = userManager.getUserByName(userName);
    if (user != null) {
      resultGraph.add(new TripleImpl(userPermissionPage,
          USERMANAGER.user, user));
      Iterator<NonLiteral> permissions = userManager
          .getPermissionsOfUser(user);
View Full Code Here


    return name;
  }

  private Set<String> retrieveAllPermissionEntriesFromUser(String userName) {
    Set<String> permissionEntries = new HashSet<String>();
    NonLiteral currentUser = (NonLiteral) userManager.getUserInSystemGraph(userName).getNode();
    Iterator<NonLiteral> roles = userManager.getRolesOfUser(currentUser);
    while(roles.hasNext()) {
      Iterator<NonLiteral> permissions = userManager.getPermissionsOfRole(roles.next());
      retrievePermissionEntries(permissionEntries, permissions);
    }
View Full Code Here

    return permissionEntries;
  }

  private void retrievePermissionEntries(Set<String> permissionEntries, Iterator<NonLiteral> permissions) {
    while(permissions.hasNext()) {
      NonLiteral permission = permissions.next();
      Lock lock = systemGraph.getLock().readLock();
      lock.lock();
      try {
        Iterator<Triple> triples = systemGraph.filter(permission, PERMISSION.javaPermissionEntry, null);
        if(triples.hasNext()) {
View Full Code Here

      @QueryParam(value = "userName") String userName,
      @Context UriInfo uriInfo) {
    AccessController.checkPermission(new UserManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    NonLiteral user = userManager.getUserByName(userName);
    if (user != null) {
      MGraph resultGraph = new SimpleMGraph();
      NonLiteral updateUserPage = new BNode();
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          USERMANAGER.UpdateUserPage));
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          PLATFORM.HeadedPage));
     

      LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
      resultGraph.add(new TripleImpl(updateUserPage, USERMANAGER.user,
          user));

      Iterator<NonLiteral> userRoles = userManager
          .getRolesOfUser(user);

      ArrayList<NonLiteral> customfields = new ArrayList<NonLiteral>();

      while (userRoles.hasNext()) {
        customfields.addAll(customPropertyManager
            .getCustomfieldsOfCollection(customPropertyManager
                .getCustomPropertyCollection(PERMISSION.Role,
                    userRoles.next().toString())));
      }
      for (NonLiteral customfield : customfields) {
        resultGraph.add(new TripleImpl(updateUserPage,
            CUSTOMPROPERTY.customfield, customfield));
        UriRef property = customPropertyManager.getCustomFieldProperty(customfield);
        NonLiteral contentUser = getCustomUser(contentGraph, userName);

        Lock readLock = contentGraph.getLock().readLock();
        readLock.lock();
        try {
          Iterator<Triple> values = contentGraph.filter(contentUser,
View Full Code Here

    String email = getTextParamValueOfForm(form, 0, "email");

    if (email != null) {
      email = email.replaceAll("mailto:", "");
    }
    NonLiteral user = (NonLiteral) userManager.getUserInSystemGraph(userName).getNode();
    if (user != null) {

      //Check if the currently logged in user has the all permissions
      String currentUserName = getCurrentUserName();
      Set<String> availablePermissionEntries = retrieveAllPermissionEntriesFromUser(currentUserName);
View Full Code Here

  public GraphNode listRoles(@Context UriInfo uriInfo) {
    AccessController.checkPermission(new UserManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral roleOverviewPage = new BNode();
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        USERMANAGER.RoleOverviewPage));
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        PLATFORM.HeadedPage));
   
View Full Code Here

    AccessController.checkPermission(new UserManagerAccessPermission());
    AccessController.checkPermission(new PermissionManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral rolePermissionPage = new BNode();
    Iterator<PermissionDescripton> permDescs = permGatherer.getAllPermissionDescriptors();
    while(permDescs.hasNext()) {
      PermissionDescripton desc = permDescs.next();
      BNode providedPermission = new BNode();
      resultGraph.add(new TripleImpl(rolePermissionPage,
          USERMANAGER.permission, providedPermission));
      resultGraph.add(new TripleImpl(providedPermission,
          PERMISSION.javaPermissionEntry, new PlainLiteralImpl(desc.getJavaPermissionString())));
      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.title, new PlainLiteralImpl(desc.getSimpleName())));
      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.description, new PlainLiteralImpl(desc.getDescription())));
    }

    resultGraph.add(new TripleImpl(rolePermissionPage, RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(rolePermissionPage, RDF.type,
        USERMANAGER.RolePermissionPage));

    NonLiteral role = userManager.getRoleByTitle(title);
    if (role != null) {
      resultGraph.add(new TripleImpl(rolePermissionPage,
          USERMANAGER.role, role));
      return new GraphNode(rolePermissionPage, new UnionMGraph(
          resultGraph, systemGraph));
View Full Code Here

  public GraphNode getAddSinglePropertyPage(
      @QueryParam(value = "roleTitle") String role) {

    AccessController.checkPermission(new UserManagerAccessPermission());
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral node = new BNode();
    resultGraph.add(new TripleImpl(node, RDF.type,
        USERMANAGER.AddCustomPropertyPage));
    resultGraph.add(new TripleImpl(node, RDF.type,
        PLATFORM.HeadedPage));
View Full Code Here

    TrailingSlash.enforceNotPresent(uriInfo);

    AccessController.checkPermission(new UserManagerAccessPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral propertyManagementPage = new BNode();
    resultGraph.add(new TripleImpl(propertyManagementPage,
        USERMANAGER.role, new PlainLiteralImpl(role)));
    resultGraph.add(new TripleImpl(propertyManagementPage, RDF.type,
        USERMANAGER.CustomFieldPage));
    resultGraph.add(new TripleImpl(propertyManagementPage, RDF.type,
View Full Code Here

    Iterator<Literal> titles = role.getLiterals(DC.title);
    String title = "";
    if(titles.hasNext()) {
      title = titles.next().getLexicalForm();
    }
    NonLiteral customFieldCollection = customPropertyManager.getCustomPropertyCollection(PERMISSION.Role, title);
    result.getGraph().add(new TripleImpl((NonLiteral) role.getNode(), USERMANAGER.custominformation,
          customFieldCollection));
 
   
  }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.NonLiteral

Copyright © 2018 www.massapicom. 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.