Package org.structr.core.entity

Examples of org.structr.core.entity.AbstractNode


      if (o instanceof String) {

        String id = (String)o;

        AbstractNode node = (AbstractNode) StructrApp.getInstance().get(id);
        if (node != null) {
          result.addContent(node);
        }
      }
    }
View Full Code Here


  //~--- methods --------------------------------------------------------
  @Override
  public void processMessage(WebSocketMessage webSocketData) {

    AbstractNode obj = getNode(webSocketData.getId());
    boolean rec = (Boolean) webSocketData.getNodeData().get("recursive");
    String principalId = (String) webSocketData.getNodeData().get("principalId");
    String permission = (String) webSocketData.getNodeData().get("permission");
    String action = (String) webSocketData.getNodeData().get("action");

    if (principalId == null) {

      logger.log(Level.SEVERE, "This command needs a principalId");
      getWebSocket().send(MessageBuilder.status().code(400).build(), true);

    }

    Principal principal = (Principal) getNode(principalId);

    if (principal == null) {

      logger.log(Level.SEVERE, "No principal found with id {0}", new Object[]{principalId});
      getWebSocket().send(MessageBuilder.status().code(400).build(), true);

    }

    webSocketData.getNodeData().remove("recursive");

    if (obj != null) {

      final App app = StructrApp.getInstance(getWebSocket().getSecurityContext());
      try (final Tx tx = app.tx()) {

        if (!getWebSocket().getSecurityContext().isAllowed(((AbstractNode) obj), Permission.accessControl)) {

          logger.log(Level.WARNING, "No access control permission for {0} on {1}", new Object[]{getWebSocket().getCurrentUser().toString(), obj.toString()});
          getWebSocket().send(MessageBuilder.status().message("No access control permission").code(400).build(), true);
          tx.success();

          return;
View Full Code Here

      return;

    }

    // check if parent node with given ID exists
    AbstractNode parentNode = getNode(parentId);

    if (parentNode == null) {

      getWebSocket().send(MessageBuilder.status().code(404).message("Parent node not found").build(), true);
View Full Code Here

    final String parentId              = (String) nodeData.get("parentId");
    final String baseUrl               = (String) nodeData.get("widgetHostBaseUrl");
    final App app                      = StructrApp.getInstance(getWebSocket().getSecurityContext());
   
    final Page page      = getPage(pageId);
    final AbstractNode origNode  = getNode(id);
   
    try {
     
      DOMNode existingParent = null;
      if (parentId != null) {
View Full Code Here

    if (securityContext != null && securityContext.getRequest() != null) {

      String nodeId = securityContext.getRequest().getParameter(parameterName);
      if (nodeId != null) {

        AbstractNode node = (AbstractNode) StructrApp.getInstance(securityContext).get(nodeId);
        if (node != null) {

          List<GraphObject> graphData = new LinkedList<>();
          graphData.add(node);
View Full Code Here

      // add only root folders to the list
      for (GraphObject obj : resultList) {

        if (obj instanceof AbstractNode) {

          AbstractNode node = (AbstractNode) obj;

          if (!node.hasIncomingRelationships(FileChildren.class)) {

            filteredResults.add(node);
          }

        }
View Full Code Here

      return;

    }

    // check if parent node with given ID exists
    AbstractNode parentNode = getNode(parentId);

    if (parentNode == null) {

      getWebSocket().send(MessageBuilder.status().code(404).message("Parent node not found").build(), true);
View Full Code Here

  @Override
  public List<T> getProperty(SecurityContext securityContext, GraphObject obj, boolean applyConverter, final org.neo4j.helpers.Predicate<GraphObject> predicate) {
   
    TraversalDescription description = traverserInterface.getTraversalDescription(securityContext);
    AbstractNode currentNode = (AbstractNode)obj;

    Comparator<AbstractNode> comparator = traverserInterface.getComparator();
    List<T> nodes = getTraversalResults(securityContext, comparator, description, currentNode);

    if (traverserInterface.collapseSingleResult() && nodes.isEmpty()) {
View Full Code Here

      }

      if (nodeExists) {

        AbstractNode foundNode = result.get(0);
        if (foundNode.getId() != object.getId()) {

          id = ((AbstractNode) result.get(0)).getUuid();

          errorBuffer.add(object.getType(), new UniqueToken(id, key, value));
View Full Code Here

  @Override
  public T getProperty(SecurityContext securityContext, GraphObject obj, boolean applyConverter, final org.neo4j.helpers.Predicate<GraphObject> predicate) {
   
    TraversalDescription description = traverserInterface.getTraversalDescription(securityContext);
    AbstractNode currentNode = (AbstractNode)obj;

    Comparator<T> comparator = traverserInterface.getComparator();
    List<T> nodes = getTraversalResults(securityContext, comparator, description, currentNode);

    if (traverserInterface.collapseSingleResult() && nodes.isEmpty()) {
View Full Code Here

TOP

Related Classes of org.structr.core.entity.AbstractNode

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.