Package org.apache.slide.structure

Examples of org.apache.slide.structure.ObjectNode


       
        try {
           
            nat.begin();
           
            ObjectNode user = new SubjectNode();
            structure.create(slideToken,user,userUri);
           
            // create the user descriptor
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
View Full Code Here


        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
           
            ObjectNode group = new SubjectNode();
            structure.create(slideToken,group,groupUri);
           
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
            descriptor.setLastModified(new Date());
View Full Code Here

        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
           
            ObjectNode role = new SubjectNode();
            structure.create(slideToken,role,roleUri);
           
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
            descriptor.setLastModified(new Date());
View Full Code Here

   */
  public ObjectNode retrieveObject(Uri uri)
    throws ServiceAccessException, ObjectNotFoundException
  {

    ObjectNode result = null;

    try
    {
      // Check if parent uri name = the turbine group uri root
      if (uri.getParentUri()
View Full Code Here

   */
  public ObjectNode retrieveObject(Uri uri)
    throws ServiceAccessException, ObjectNotFoundException
  {

    ObjectNode result = null;

    try
    {
      // Check if parent uri name = the turbine group uri root
      if (uri.getParentUri()
View Full Code Here

     * @exception ObjectNotFoundException The object to retrieve was not found
     */
    public ObjectNode retrieveObject(Connection connection, Uri uri)
        throws ServiceAccessException, ObjectNotFoundException {

        ObjectNode result = null;
        PreparedStatement statement = null;

        try {

            statement =
View Full Code Here

        }
    }

    public ObjectNode retrieveObject(Connection connection, Uri uri)
        throws ServiceAccessException, ObjectNotFoundException {
        ObjectNode result = null;
        try {
            PreparedStatement statement = null;
            ResultSet res = null;
            String className;
            Vector children = new Vector();
            Vector parents = new Vector();
            Vector links = new Vector();
            try {
                statement =
                    connection.prepareStatement(
                        "select o.CLASS_NAME from OBJECT o, URI u where o.URI_ID = u.URI_ID and u.URI_STRING = ?");
                statement.setString(1, uri.toString());
                res = statement.executeQuery();
                if (res.next()) {
                    className = res.getString(1);
                } else {
                    throw new ObjectNotFoundException(uri);
                }
            } finally {
                close(statement, res);
            }

            try {
                statement =
                    connection.prepareStatement(
                        "SELECT c.NAME, cu.URI_STRING FROM URI u, URI cu, BINDING c WHERE cu.URI_ID = c.CHILD_UURI_ID AND c.URI_ID = u.URI_ID and u.URI_STRING = ?");
                statement.setString(1, uri.toString());
                res = statement.executeQuery();
                while (res.next()) {
                    children.addElement(new ObjectNode.Binding(res.getString(1), res.getString(2)));
                }
            } finally {
                close(statement, res);
            }

            try {
                statement =
                    connection.prepareStatement(
                        "SELECT c.NAME, cu.URI_STRING FROM URI u, URI cu, PARENT_BINDING c WHERE cu.URI_ID = c.PARENT_UURI_ID AND c.URI_ID = u.URI_ID and u.URI_STRING = ?");
                statement.setString(1, uri.toString());
                res = statement.executeQuery();
                while (res.next()) {
                    parents.addElement(new ObjectNode.ParentBinding(res.getString(1), res.getString(2)));
                }
            } finally {
                close(statement, res);
            }

            try {
                statement =
                    connection.prepareStatement(
                        "SELECT lu.URI_STRING FROM URI u, URI lu, LINKS l WHERE lu.URI_ID = l.URI_ID AND l.LINK_TO_ID = u.URI_ID and u.URI_STRING = ?");
                statement.setString(1, uri.toString());
                res = statement.executeQuery();
                while (res.next()) {
                    links.addElement(res.getString(1));
                }
            } finally {
                close(statement, res);
            }
            if (className.equals(LinkNode.class.getName())) {
                try {
                    statement =
                        connection.prepareStatement(
                            "SELECT lu.URI_STRING FROM URI u, URI lu, LINKS l WHERE lu.URI_ID = l.LINK_TO_ID AND l.URI_ID = u.URI_ID and u.URI_STRING = ?");
                    statement.setString(1, uri.toString());
                    res = statement.executeQuery();
                    if (res.next()) {
                        String linkTarget = res.getString(1);
                        result = new LinkNode(uri.toString(), children, links, linkTarget);
                    } else {
                        result = new LinkNode(uri.toString(), children, links);
                    }
                } finally {
                    close(statement, res);
                }
            } else {
                try {
                    Class objclass = Class.forName(className);
                    Class argClasses[] = { String.class, Vector.class, Vector.class, Vector.class };
                    Object arguments[] = { uri.toString(), children, parents, links };
                    Constructor constructor = objclass.getConstructor(argClasses);
                    result = (ObjectNode) constructor.newInstance(arguments);
                    result.setUri(result.getUuri());
                } catch (Exception e) {
                    throw new ServiceAccessException(service, e);
                }
            }
        } catch (SQLException e) {
View Full Code Here

            } catch (ClassNotFoundException e) {
                // Class loading failed : The requested class was not found
                // We throw an exception and interrupt the loading of the file.
                throw new UnknownObjectClassException(className);
            }
            ObjectNode object = null;
            try {
                // Get a new instance of the class
                object = (ObjectNode) objectClass.newInstance();
            } catch(InstantiationException e) {
                // Instantiation failed for some reason
View Full Code Here

        responseElement.addContent(statusElement);

        Enumeration childrenEnum = null;
        try {
            if ( isCollection(resourcePath) && (depth > 0) ) {
                ObjectNode currentNode = structure.retrieve(slideToken, resourcePath);
                childrenEnum = structure.getChildren(slideToken, currentNode);
            }

            checkPreconditions(updateSourcePath, updateLabelName, resourcePath);
View Full Code Here

        String privilegeNamespace = privilegeChildElm.getNamespaceURI();
        if (E_ALL.equals(privilegeName) && S_DAV.equals(privilegeNamespace)) {
            return ActionNode.ALL_URI;
        }
        else {
            ObjectNode actions = structure.retrieve(slideToken, token.getNamespaceConfig().getActionsPath());
            ObjectNode action = findAction(actions.getChildren().iterator(), privilegeName, privilegeNamespace);
            return action != null ? action.getUri() : null;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.structure.ObjectNode

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.