Package org.apache.clerezza.rdf.utils

Examples of org.apache.clerezza.rdf.utils.GraphNode.addProperty()


  result.addProperty(RDF.type, LOGIN.LoginPage);

  String baseUri = uriInfo.getBaseUri().getScheme() + "://"
    + uriInfo.getBaseUri().getAuthority();

  result.addProperty(LOGIN.refererUri, new UriRef(baseUri + "/dashboard/overview"));
  return result;
    }

    public static Cookie getLogoutCookie() {
  Cookie cookie = new Cookie(CookieLogin.AUTH_COOKIE_NAME, null);
View Full Code Here


  public GraphNode loginPage(@Context UriInfo uriInfo,
      @QueryParam("referer") String refererUri,
      @QueryParam("cause") Integer cause) {
    TrailingSlash.enforceNotPresent(uriInfo);
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, LOGIN.LoginPage);
    result.addProperty(LOGIN.refererUri, new UriRef(refererUri));
    String user = getUserName();
    if (!user.equals("anonymous") && cause != null &&
        cause.equals(CookieAuthentication.NOT_ENOUGH_PERMISSIONS)) {
      try {
View Full Code Here

      @QueryParam("referer") String refererUri,
      @QueryParam("cause") Integer cause) {
    TrailingSlash.enforceNotPresent(uriInfo);
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, LOGIN.LoginPage);
    result.addProperty(LOGIN.refererUri, new UriRef(refererUri));
    String user = getUserName();
    if (!user.equals("anonymous") && cause != null &&
        cause.equals(CookieAuthentication.NOT_ENOUGH_PERMISSIONS)) {
      try {
        result.addProperty(LOGIN.message, new PlainLiteralImpl("The user " +
View Full Code Here

    result.addProperty(LOGIN.refererUri, new UriRef(refererUri));
    String user = getUserName();
    if (!user.equals("anonymous") && cause != null &&
        cause.equals(CookieAuthentication.NOT_ENOUGH_PERMISSIONS)) {
      try {
        result.addProperty(LOGIN.message, new PlainLiteralImpl("The user " +
            user + " does not have the required permissions to view this page" +
            " (" + URLDecoder.decode(refererUri, "UTF-8") + ")." +
            " Please log in as another user."));
      } catch (UnsupportedEncodingException ex) {
        throw new RuntimeException(ex);
View Full Code Here

      @Context final UriInfo uriInfo) {
    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
      @Override
      public Object run() {
        GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
        result.addProperty(RDF.type, LOGIN.LoginPage);
        PlainLiteral failedMessage = new PlainLiteralImpl(
            "Username name or password are wrong");
        try {
          if (authenticationService.authenticateUser(userName,password)) {
            Set<LoginListener> tempLoginListenerSet = null;
View Full Code Here

              referer, uriInfo));
            responseBuilder.header(HttpHeaders.SET_COOKIE,
                getLoginCookie(userName, password, stayLoggedIn));
            return responseBuilder.build();
          } else {
            result.addProperty(LOGIN.message, failedMessage);
            result.addProperty(LOGIN.refererUri, new UriRef(referer));
          }
          return result;
        } catch (NoSuchAgent ex) {
          result.addProperty(LOGIN.message, failedMessage);
View Full Code Here

            responseBuilder.header(HttpHeaders.SET_COOKIE,
                getLoginCookie(userName, password, stayLoggedIn));
            return responseBuilder.build();
          } else {
            result.addProperty(LOGIN.message, failedMessage);
            result.addProperty(LOGIN.refererUri, new UriRef(referer));
          }
          return result;
        } catch (NoSuchAgent ex) {
          result.addProperty(LOGIN.message, failedMessage);
          result.addProperty(LOGIN.refererUri, new UriRef(referer));
View Full Code Here

            result.addProperty(LOGIN.message, failedMessage);
            result.addProperty(LOGIN.refererUri, new UriRef(referer));
          }
          return result;
        } catch (NoSuchAgent ex) {
          result.addProperty(LOGIN.message, failedMessage);
          result.addProperty(LOGIN.refererUri, new UriRef(referer));
          return result;
        }
      }
    });
View Full Code Here

            result.addProperty(LOGIN.refererUri, new UriRef(referer));
          }
          return result;
        } catch (NoSuchAgent ex) {
          result.addProperty(LOGIN.message, failedMessage);
          result.addProperty(LOGIN.refererUri, new UriRef(referer));
          return result;
        }
      }
    });
  }
View Full Code Here

    AccessController.checkPermission(new LoggingManagerAccessPermission());
    TrailingSlash.enforcePresent(uriInfo);
    SimpleMGraph resultMGraph = new SimpleMGraph();
    GraphNode result = new GraphNode(new BNode(), resultMGraph);
    result.addPropertyValue(LOGGING.loggingConfig, getPropertiesAsString());
    result.addProperty(RDF.type, PLATFORM.HeadedPage);
    result.addProperty(RDF.type, LOGGING.LoggingConfigPage);
    return result;
  }

  private String getPropertiesAsString()
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.