Package org.apache.slide.structure

Examples of org.apache.slide.structure.ObjectNode


        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

        if (uri instanceof ResourceId) {
            super.storeObject(uri, object);
        }
        else {
            ResourceId resourceId = obtainResourceId(uri);
            ObjectNode objectClone = object.cloneObject();
            objectClone.setUri(resourceId.getUuri()); // switch to uuri
            resourceId.getStore().storeObject(resourceId, objectClone);
        }
    }
View Full Code Here

            super.createObject(uri, object);
        }
        else {
            ResourceId resourceId = ResourceId.createNew(uri);
            object.setUuri(resourceId.getUuri());
            ObjectNode objectClone = object.cloneObject();
            objectClone.setUri(resourceId.getUuri()); // switch to uuri
            cacheResolve(uri, resourceId);
            resourceId.getStore().createObject(resourceId, objectClone);
        }
    }
View Full Code Here

        if (uri instanceof ResourceId) {
            super.removeObject(uri, object);
        }
        else {
            ResourceId resourceId = obtainResourceId(uri);
            ObjectNode objectClone = object.cloneObject();
            objectClone.setUri(resourceId.getUuri()); // switch to uuri
            cacheResolve(uri, null);
            resourceId.getStore().removeObject(resourceId, objectClone);
        }
    }
View Full Code Here

        if (uri instanceof ResourceId) {
            return super.retrieveRevisionDescriptor(uri, revisionNumber);
        }
        else {
            try {
                ObjectNode objectNode = doRetrieveObjectNode(uri);
                ResourceId resourceId = obtainResourceId(uri);
                NodeRevisionDescriptor nrd = resourceId.getStore().retrieveRevisionDescriptor(resourceId, revisionNumber);
                nrd.setProperty("resource-id", resourceId.asXml());
                nrd.setProperty("parent-set", getXmlParentSet(uri, objectNode));
                return nrd;
View Full Code Here

    }
   
    private ObjectNode doRetrieveObjectNode(Uri uri)
        throws ServiceAccessException, ObjectNotFoundException  {
       
        ObjectNode result;
        if (Configuration.useBinding(this)) {
            result = doResolve(uri);
            result.setUuri(result.getUri());
            result.setUri(uri.toString()); // switch to uri
        } else {
            ResourceId resourceId = ResourceId.create(uri, uri.toString());
            result = resourceId.getStore().retrieveObject(resourceId);
            result.setUuri(result.getUri());
        }
        return result;
    }
View Full Code Here

           
            for (int i = start; i < segments.length; i++) {
                // cacheResolve(currentUri, currentResourceId);
                // TODO: make it work with caching here :-(
               
                ObjectNode objectNode = currentResourceId.getStore().retrieveObject(currentResourceId);
                objectNode.setUri(currentUriStr);
                currentUriStr = uriPath.subUriPath(0, i + 1).toString();
                currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
                String currentUuri = objectNode.getBindingUuri(segments[i]);
                if (currentUuri == null) {
                    throw new ObjectNotFoundException(currentUriStr);
                }
                currentResourceId = ResourceId.create(currentUri, currentUuri);
            }
View Full Code Here

        }
        return resourceId;
    }
   
    private ResourceId obtainResourceId(Uri uri) throws ServiceAccessException, ObjectNotFoundException {
        ObjectNode objectNode = doRetrieveObjectNode(uri);
        ResourceId resourceId = ResourceId.create(uri, objectNode.getUuri());
        return resourceId;
    }
View Full Code Here

        if (nodeStore.cacheResults()) {
            Object tempObject = objectsCache.get(uri.toString());
            if (tempObject != null) {
                return ((ObjectNode) tempObject).cloneObject();
            } else {
                ObjectNode objectNode = nodeStore.retrieveObject(uri);
                objectNode.validate(uri.toString());
                objectsCache.put(uri.toString(), objectNode.cloneObject());
                return objectNode;
            }
        } else {
            return super.retrieveObject(uri);
        }
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.